SQL查找某一條記錄的方法

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)

(注:表中必須有一個唯一值字段才可適用此方法。)

? 版權聲明
THE END
喜歡就支持一下吧
點贊15 分享