本文共 359 字,大约阅读时间需要 1 分钟。
declare @col1 varchar(1000) declare @col2 varchar(1000) set @col1='34,67,89,36' set @col2='123.456.89.980' set @col1=' select id=' + replace(@col1,',',' union all select ') set @col2=' select id=' + replace(@col2,'.',' union all select ') set @col1=' select b.* from (' + @col1 + ') a right join (' + @col2 + ') b on a.id=b.id where a.id is null 'exec(@col1)
转载地址:http://glzmi.baihongyu.com/