日期:2014-05-18 浏览次数:20541 次
select b.fileno from a,b where charindex(a.grup,Priv)>0 and a.UserID=1
------解决方案--------------------
declare @表A table(userid int,grup varchar(10)) insert into @表A select 1,2 insert into @表A select 1,4 insert into @表A select 2,3 declare @表B table(FileNo varchar(10),Priv varchar(10)) insert into @表B select '1001','1,2,5' insert into @表B select '1002','2,3' insert into @表B select '1003','3' declare @userid int set @userid=1 select fileno from @表A a,@表B b where charindex(a.grup,b.priv)>0 and a.userid=@userid