我希望我的结果按a.right
(它可能有 2 个值:1 - true,0 - false)排序。a.right=1
必须先出现的行。试过了GROUP BY
。但没有帮助。如何达到上述结果?
SELECT
u.fullname,
a.id,
a.content,
a.addDT,
a.`right`,
acr.score,
acr.checkDT
FROM
answers a
INNER JOIN users u ON u.id = a.uid
LEFT JOIN `answer_chk_results` acr ON acr.aid = a.id
WHERE
a.qid = 1
GROUP BY
a.`right` DESC