本人想排序,首先按"总量"降序,在按"颜色量"排序,最后按"客户数量"排序.这个应该怎么排。
请看图片。FINEreport里面排序。
select style_id,name,goods_code,color,size_sub_id,size_id,sum(COUNT) as count from
(SELECT a.*,b.goods_code,b.style_id,d.color,c.region,c.name 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."COLOR_T" d on d.id=A.color_id where a.freeze =0
${if(len(region)==0,"","and c.region in('"+region+"')")})
group by name,goods_code,color,size_sub_id,size_id,style_id
order by count desc
这个是我的 SQL语句