declare @kc money,@sql varchar(8000)
set @kc=50
......
set @sql='select b.clsname,a.* from ([email protected]+') as a,clsitem b where countn<=变量KC and a.clscode=b.clscode'
代码该如何写啊?是countn<[email protected]+'''还是什么呢?
------解决方案--------------------
- SQL code
countn<=''''+ltrim(@kc)+''''
------解决方案--------------------
- SQL code
set @sql='select b.clsname,a.* from ([email protected]+') as a,clsitem b where countn<= [email protected]+''' and a.clscode=b.clscode'