sql语句 大家帮看一下把 想分组 用GROUP_CONCAT显示数据 能对这里进行排序吗

HelloChina 发布于 2012/12/14 11:00
阅读 7K+
收藏 1

询问 询问  sql语句啊

表数据

SELECT b.did,GROUP_CONCAT(b.sid) FROM dishes a RIGHT JOIN dishes_relation b ON a.id=b.did
WHERE a.`ofdishes`=1
GROUP BY b.did
ORDER BY adjustment DESC,similar DESC

GROUP_CONCAT(b.sid) 对他能进行排序吗

先 adjustment 降序,在 similar 降序 

加载中
1
aqqn
aqqn
SELECT b.did,GROUP_CONCAT(b.sid) FROM test b  GROUP BY b.did 
ORDER BY adjustment DESC,similar DESC
HelloChina
HelloChina
学习到了 谢谢
aqqn
aqqn
晕,错了,是: SELECT b.did,GROUP_CONCAT(b.sid ORDER BY adjustment DESC,similar DESC) FROM test b GROUP BY b.did
0
HelloChina
HelloChina

引用来自“aqqn”的答案

SELECT b.did,GROUP_CONCAT(b.sid) FROM test b  GROUP BY b.did 
ORDER BY adjustment DESC,similar DESC
学习到了 谢谢
返回顶部
顶部