Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何按一列对条目进行排序(比如说命名column13)。首先应该column13是“val”的条目,然后是“aaa”,然后是“ccc”。我不能使用GROUP BY column13 ASC或类似的。是否可以在不编写 3 个查询的情况下做到这一点?
column13
GROUP BY column13 ASC
使用FIELD()MySQL 中可用的构造:
FIELD()
SELECT stuff FROM table WHERE condition ORDER BY FIELD(column13, 'val', 'aaa', 'ccc')