SQL查找某一条记录的方法分享


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)

(注:表中必须有一个唯一值字段才可适用此方法。)

—-想了解更多的数据库相关异常处理怎么解决关注<计算机技术网(www.ctvol.com)!!>



www.ctvol.com true Article SQL查找某一条记录的方法分享

本文来自网络收集,不代表计算机技术网立场,如涉及侵权请联系管理员删除。

ctvol管理联系方式QQ:251552304

本文章地址:https://www.ctvol.com/dtteaching/80478.html

(0)
上一篇 2020年4月17日 上午7:42
下一篇 2020年4月17日 上午7:43

精彩推荐