select top 9 *from 表名 whereid not in (select top 3 * from 表名)
mssql 查詢語句中 select top 9 * from 是查詢前9條內(nèi)容。我想查詢由第3條開始到第9條內(nèi)容如何查詢求高手給解答
select top 9 *from 表名 whereid not in (select top 3 * from 表名)
select * from table where tableID between 3 and 9用between關(guān)鍵字可以查詢指定數(shù)的記錄。
我想你是想做分頁查詢,如果是的話,最好是用存儲(chǔ)過程或者用自定義函數(shù)來實(shí)現(xiàn)。這樣比較通用一些
嘗試使用以下的SQL語句:select top 6 * from (select top 9 * from [table] order by id)order by id desc