SELECT id_emoticon, title, category
FROM emoticons
WHERE id_emoticon IN (4, 4, 4, 4, 3)
ORDER BY id_emoticon DESC
我有这样的查询,我得到的结果只有一个 4 和一个 3 id。我需要我在 WHERE 子句中提供的所有 ID。
有什么想法吗?
最佳答案
我猜你想要 id_emoticon 4 后跟 3 的顺序,按 id_emoticon 的降序排列
如果是这种情况,请使用以下内容
SELECT id_emoticon, title, category
FROM fe_emoticons
WHERE id_emoticon IN (4, 4, 4, 4, 3)
ORDER BY id_emoticon DESC
关于mysql - mysql按字段排序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14314694/