--try
select * from grp a where 
exists  (select 1 from usename where usename='1' and 
charindex(','+cast(a.id as varchar)+',',','+fwdetail )>0)

解决方案 »

  1.   

    try:
    select * from grp where charindex(id,(select fwdetail from usename where usename='1'))>0
      

  2.   

    上面好象不行
    在in后面好象一定要象'1','2','3'这样,
    select * from grp where id in ('1','2','3')就可以.
      

  3.   

    declare @s varchar(1000)
    select @s=cast(fwdetail as varchar(1000)) from usename where usename='bbb'
    select * from grp where charindex(','+cast(id as varchar)+',',@s)>0
    这样可以了,但是有个问题是第一条记录读不出来.因为数是1,2,3,4   而','+cast(id as varchar)+','是,1,
      

  4.   

    搞定了,让stuff插入一个,就可以了.谢谢 wgsasd311(自强不息) scmail81(琳·风の狼)