我想先打印趋势行,然后打印新行,然后打印“employee”表中的所有其他行。我还想限制行数和降序我在试这个
SELECT * FROM (SELECT * FROM employee LIMIT 7) sub ORDER BY id DESC
预期结果
7fyelxc51#
你可以试着点一份 CASE 表达式:
CASE
SELECT id, Name, Status FROM employee ORDER BY CASE Status WHEN 'Trending' THEN 1 WHEN 'NEW' THEN 2 ELSE 3 END, id DESC LIMIT 7;
1条答案
按热度按时间7fyelxc51#
你可以试着点一份
CASE
表达式: