yzm244954(提问者)select convert(varchar(10),a.date,23) date,a.num,b.num,c.fquantity,
a.storeid,a.season,a.brand,a.attr,a.cpx,a.cpx2
from DFM_SALE_MQ a join DFM_SALE_MQ_SJ_FH b
on convert(varchar(10),a.date,23) = convert(varchar(10),b.date,23)
join (select * from fr_vw_shangpin a join SG_Gatherings b on a.商品编号 = b.vStyle) c
on convert(varchar(10),a.date,23) = convert(varchar(10),c.上市日期,23)
where 1=1
${if(len(STORE) == 0,\"\",\"and STOREID in (\'\" + STORE + \"\')\")}
${if(len(SEASONID) == 0,\"\",\"and SEASON in (\'\" + SEASONID + \"\')\")}
${if(len(BRANDID) == 0,\"\",\"and BRAND in (\'\" + BRANDID + \"\')\")}
${if(len(ATTRID) == 0,\"\",\"and ATTR in (\'\" + ATTRID + \"\')\")}
${if(len(CPXID) == 0,\"\",\"and CPX in (\'\" + CPXID + \"\')\")}
${if(len(CPX2ID) == 0,\"\",\"and CPX2 in (\'\" + CPX2ID + \"\')\")}
${if(len(DATE_START)=0 || len(DATE_END)=0,\"\",\" and a.date BETWEEN \'\"+DATE_START+\"\' AND \'\"+DATE_END+\"\'\")}
我是这么写的
yzm244954(提问者)我这么写的 不知道为什么不行
select convert(varchar(10),a.date,23) date,a.num,b.num,c.fquantity,
a.storeid,a.season,a.brand,a.attr,a.cpx,a.cpx2
from DFM_SALE_MQ a join DFM_SALE_MQ_SJ_FH b
on convert(varchar(10),a.date,23) = convert(varchar(10),b.date,23)
join (select * from fr_vw_shangpin a join SG_Gatherings b on a.商品编号 = b.vStyle) c
on convert(varchar(10),a.date,23) = convert(varchar(10),c.上市日期,23)
where 1=1
${if(len(STORE) == 0,\"\",\"and STOREID in (\'\" + STORE + \"\')\")}
${if(len(SEASONID) == 0,\"\",\"and SEASON in (\'\" + SEASONID + \"\')\")}
${if(len(BRANDID) == 0,\"\",\"and BRAND in (\'\" + BRANDID + \"\')\")}
${if(len(ATTRID) == 0,\"\",\"and ATTR in (\'\" + ATTRID + \"\')\")}
${if(len(CPXID) == 0,\"\",\"and CPX in (\'\" + CPXID + \"\')\")}
${if(len(CPX2ID) == 0,\"\",\"and CPX2 in (\'\" + CPX2ID + \"\')\")}
${if(len(DATE_START)=0 || len(DATE_END)=0,\"\",\" and a.date BETWEEN \'\"+DATE_START+\"\' AND \'\"+DATE_END+\"\'\")}