declare @num int
set @num=9
exec('select top ' + @num + ' * from 职工 where 仓库号 in(wh1,wh4)')和select top 9 * from 职工 where 仓库号 in('wh1','wh2')怎么实现啊,上面使用动态SQL出现错误! 拜求~
set @num=9
exec('select top ' + @num + ' * from 职工 where 仓库号 in(wh1,wh4)')和select top 9 * from 职工 where 仓库号 in('wh1','wh2')怎么实现啊,上面使用动态SQL出现错误! 拜求~
exec('select top ' + ltrim(@num) + ' * from 职工 where 仓库号 in(''wh1'',''wh4'')')
exec('select top '+@num+' * from 职工 where 仓库号 in(''wh1'',''wh2'')')