标签: sql-server
如何动态选择TOP行?
TOP
此代码无效:
Declare @Number int Set @Number= 6 select Top @Number ID from tblEmployee
答案 0 :(得分:3)
您需要将其包裹在圆括号中:
select Top (@Number) ID from tblEmployee