奥礼网
新记
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
相似回答
大家正在搜
相关问题
sql语句怎样从数据库中查找某一条到某一条之间的记录
SQL语句如何返回某条记录在记录集中的第几条
SQL 在查询结果中选取某一条数据 怎么实现
SQL 怎么将数据重新到旧,并将置顶显示前面
请问怎么用SQL语句取出数据库中的特定一条数据
mssql中,如何返回指定第几到第几条之间的记录
一条sql语句 按照时间取出置顶的前三条,在按照时间排序,返...
如何取SQL结果集的第一条记录