日期:2014-05-18 浏览次数:20449 次
exec('select * from table where columnName in('+@tem+')')
------解决方案--------------------
exec('select * from table where columnName in('+@tem+')')
------解决方案--------------------
declare @tem as varchar(20) set @tem = '11,12,13' print('select * from table where columnName in (' + cast(@tem as varchar) + ')') /* select * from table where columnName in (11,12,13) */ exec('select * from table where columnName in (' + cast(@tem as varchar) + ')')