MYSQL查询正在按照我的意愿获取数据。但是ORDER BY
子句不起作用。
但是当我从查询中删除GROUP BY
时,ORDER BY
子句就可以了。
SELECT MESS. * , US. * , LF. *
FROM messages MESS
LEFT JOIN users AS US ON US.id = MESS.to_id
LEFT JOIN label_infos LF ON LF.user_id = MESS.to_id
WHERE MESS.frm_id =27
OR MESS.to_id =27
GROUP BY US.id
ORDER BY MESS.id DESC