我有这个查询:
SELECT
CONCAT(users.id, '#_#', users.nickname, '#_#', users.avatar, '#_#',
questions.datetime,'#_#',questions.question,'#_#',0000) as summary
FROM
`questions` join users
on users.id = questions.id_user
WHERE
questions.id = 12
UNION
SELECT
CONCAT(users.id, '#_#', users.nickname, '#_#', users.avatar, '#_#',
answers.datetime,'#_#',answers.answer,'#_#',answers.id) as summary
FROM
answers join users
on users.id = answers.id_user where id_question = 12
此查询必须包含一列(带有连接数据),我需要按 answers.datetime 排序,但我自己无法找到解决方案......
一些mysql大师可以帮助我吗?
谢谢 :)