select * , group_concat( ' ' , concat_ws( ' x ', `sku` , `quantity-purchased` ) , ' ' ),group_concat(' ' , `order_id` , ' ') from `sale_orders` where `shipments` =0 and `number` =1 group by group_concat( ' ' , concat_ws( ' x ', `sku` , `quantity-purchased` ) , ' ' )
我想要按照group_concat( ' ' , concat_ws( ' x ', `sku` , `quantity-purchased` ) , ' ' )这个统计出来的字段排序,请问应该怎么做呢??
------解决方案--------------------
sql codeselect * , group_concat( ' ' , concat_ws( ' x ', `sku` , `quantity-purchased` ) , ' ' ) as str ,group_concat(' ' , `order_id` , ' ') from `sale_orders` where `shipments` =0 and `number` =$id group by `recipient-name` , `ship-address-1` order by str
