我有以下代码用于按行和起点查询数据:
SELECT InquiryId
FROM (select InquiryId, ROW_NUMBER() over (order by InquiryId) as Seq
from [InquiryTable] WITH(NOLOCK)
where InquiryId >= 100 and InquiryId <= 200)t
where Seq Between 1 and 20
SQL Server中第四行末尾的字符“t”是什么意思?
谢谢
最佳答案
这是一个有用的视觉图,显示了 t
是如何成为别名的:
SELECT *
FROM table t
用子查询替换表
:
SELECT *
FROM (SELECT * FROM table) t
关于sql - SQL Server中子查询末尾的 't'是什么意思,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53323405/