select style,wave,code,size_sub_id,sum(COUNT) as count,sum(JIN) as JIN from (SELECT A.*,D.style,E.wave,a.count*b.price as jin FROM BIBEI."ORDER_T" a join BIBEI."GOODS_T" b on a.code=b.code join BIBEI."CUSTOMER_T" c on c. account=a.account join BIBEI."STYLE_T" D ON B.STYLE_ID = D.ID JOIN BIBEI."WAVE_T" E ON B.WAVE_ID = E.ID where a.freeze=0 ${if(len(account)==0,"","and a.account ='"+account+"'")} ${if(len(region)==0,"","and c.region ='"+region+"'")}) group by style,wave,code,size_sub_id 上述是SQL 语句图片为得出来的结果。 现在我想统计相同的CODE 的个数不要重复的。 例如:我需要得出120的个数是1个 怎么用SQL表达或者FINE |