位置:首頁 > 軟件操作教程 > 數(shù)據(jù)分析 > SQL > 問題詳情

SQL操作應(yīng)用——:select top 30 recid from A where recid>-1

提問人:ylm發(fā)布時間:2020-09-30

在那個子查詢中也加條件:select top 30 recid from A where recid>-1

例2:查詢表中的最后以條記錄,并不知道這個表共有多少數(shù)據(jù),以及表結(jié)構(gòu)。
set @s = 'select top 1 * from T   where pid not in (select top ' + str(@count-1) + ' pid  from  T)'

print @s      exec  sp_executesql  @s

繼續(xù)查找其他問題的答案?

相關(guān)視頻回答
回復(fù)(0)
返回頂部