SQL 整个结果中的一个值将移动到顶部


SQL One value from whole result move to the top

尽管有GROUP,ORDER和另一个参数,如何将选择结果行之一移动到顶部?例如在 SqlFiddle 上

将第 3 行(类型为 Loren)移到顶部 ?

select id, type, details from dummyTable order by type="Lorem" DESC

和 SQL 小提琴网址

答案是

select id, type, details from dummyTable ORDER BY IF(type = 'Test', 0, 1), id LIMIT 0, 5

SqlFiddle 示例