A anchony Unregistered / Unconfirmed GUEST, unregistred user! 2009-09-21 #1 declare @nRow intset @nRow=10select top @nRow * from ec_6ball order by fIssue@nRow报错,这里一定得要一个变量,我该怎么办呀?
declare @nRow intset @nRow=10select top @nRow * from ec_6ball order by fIssue@nRow报错,这里一定得要一个变量,我该怎么办呀?
D Dstorm Unregistered / Unconfirmed GUEST, unregistred user! 2009-09-21 #2 作为字符串来吧!~exec('select top'+ @nRow+' * from ec_6ball order by fIssue')
A anchony Unregistered / Unconfirmed GUEST, unregistred user! 2009-09-21 #3 declare @nRow intset @nRow=10exec('select top'+ @nRow+' * from ec_6ball order by fIssue') 晕了,还是报,在关键字 'from' 附近有语法错误。
declare @nRow intset @nRow=10exec('select top'+ @nRow+' * from ec_6ball order by fIssue') 晕了,还是报,在关键字 'from' 附近有语法错误。
D Dstorm Unregistered / Unconfirmed GUEST, unregistred user! 2009-09-21 #4 看看表有没有问题!~我刚试过:declare @nRow intset @nRow=5exec('select top '+@nRow+'* from table1')没问题的