in括号中逗号的问题,比较简单
xielk 2005-09-14 03:11:52 select * from sx where cast (id as char) in ('1','2') 返回结果
select * from sx where cast (id as char) in ( ' ''1'',''2'' ' )没有结果返回
select ' ''1'',''2''' ='1','2'
问怎样才能使
Set @s='1','2'
select * from sx where cast (id as char) in (@s)有结果返回
也就是说@s返回的值应该为'1','2'