数据库 
首页 > 数据库 > 浏览文章

SQL查找某一条记录的方法

(编辑:jimmy 日期: 2024/5/31 浏览:3 次 )
SQL查找第n条记录的方法:
select top 1 * from table where id not in (select top n-1 id from table) temptable0

SQL查找第n条开始的m条记录的方法:
select top m * from table where id not in (select top n-1 id from table) temptable0)

(注:表中必须有一个唯一值字段才可适用此方法。) 
上一篇:在SQL中使用convert函数进行日期的查询的代码
下一篇:mssql中得到当天数据的语句
友情链接:杰晶网络 DDR爱好者之家 南强小屋 黑松山资源网 白云城资源网