sql变量需要加小括号

declare @num int

select top (@num) * from A

--注意,使用变量来查询的时候,单个变量需要使用()

原文地址:https://www.cnblogs.com/renzaijianghu/p/6614153.html