select Prod_id,prod_apply_person,state,state2,Prod_type,Prod_name_eng,prod_name,prod_sort,prod_make_co,Prod_sureness_stock='*******' ,prod_apply_date
from product where 1=1 and prod_apply_person=1 union all select prod_id,prod_apply_person,state,state2,prod_type ,Prod_name_eng ,Prod_name ,prod_sort ,prod_make_co='*******' ,cast(Prod_sureness_stock as varchar(100)),prod_apply_date
from product where 1=1 and prod_apply_person<>1
from product where 1=1 and prod_apply_person=1 union all select prod_id,prod_apply_person,state,state2,prod_type ,Prod_name_eng ,Prod_name ,prod_sort ,prod_make_co='*******' ,cast(Prod_sureness_stock as varchar(100)),prod_apply_date
from product where 1=1 and prod_apply_person<>1
,Prod_sureness_stock='*******'改为:
select Prod_id,prod_apply_person,state,state2,Prod_type,Prod_name_eng,prod_name,prod_sort,prod_make_co,cast(Prod_sureness_stock as varchar)='*******' ,prod_apply_date
from product where 1=1 and prod_apply_person=1 union all
select prod_id,prod_apply_person,state,state2,prod_type ,Prod_name_eng ,Prod_name ,prod_sort ,prod_make_co='*******' ,Prod_sureness_stock,prod_apply_date
from product where 1=1 and prod_apply_person<>1
from product where 1=1 and prod_apply_person=1 union all
select prod_id,prod_apply_person,state,state2,prod_type ,Prod_name_eng ,Prod_name ,prod_sort ,prod_make_co='*******' ,cast(Prod_sureness_stock as varchar(50)),prod_apply_date
from product where 1=1 and prod_apply_person<>1
---------------------------------^^^用半角的=号
from product where 1=1 and prod_apply_person=1 union all
select prod_id,prod_apply_person,state,state2,prod_type ,Prod_name_eng ,Prod_name ,prod_sort ,prod_make_co='*******' ,Prod_sureness_stock,prod_apply_date
from product where 1=1 and prod_apply_person<>1
product.prod_make_co和 product.Prod_sureness_stock有没有数据值的字段?
,Prod_sureness_stock='*******'改为:
select Prod_id,prod_apply_person,state,state2,Prod_type,Prod_name_eng,prod_name,prod_sort,prod_make_co,cast(Prod_sureness_stock as varchar)='*******' ,prod_apply_date
from product where 1=1 and prod_apply_person=1 union all
select prod_id,prod_apply_person,state,state2,prod_type ,Prod_name_eng ,Prod_name ,prod_sort ,prod_make_co='*******' ,Prod_sureness_stock,prod_apply_date
from product where 1=1 and prod_apply_person<>1