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

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

提問(wèn)人:ylm發(fā)布時(shí)間:2020-09-30

在那個(gè)子查詢(xún)中也加條件:select top 30 recid from A where recid>-1

例2:查詢(xún)表中的最后以條記錄,并不知道這個(gè)表共有多少數(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ù)查找其他問(wèn)題的答案?

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