sql 中如何将返回的记录某一条置顶

如题所述

第1个回答  推荐于2016-10-14
将table1中id 为2的记录置顶
select * from table1
order by case when id='2' then 0 else 1 end本回答被提问者和网友采纳
第2个回答  2010-11-29
select * from table1 where id=2
union all
select * from table1 where id<>2
相似回答