日期:2014-05-18 浏览次数:20756 次
declare @ID int, @UID int set @ID=1 set @UID=1 select * from FileManager where FolderID =(select ID from FolderManager where ID=@ID) and ID in(select FileID from FileRight where InfoUserIDs like '%'+CAST(@UID as varchar(20))+'%')
where ','+InfoUserIDs+',' like '%,'+CAST(@UID as varchar(20))+',%')
------解决方案--------------------
charindex
------解决方案--------------------
try this,
declare @ID int, @UID int set @ID=1 set @UID=1 select * from FileManager where FolderID =(select ID from FolderManager where ID=@ID) and ID in(select FileID from FileRight where charindex(CAST(@UID as varchar(20))+',',InfoUserIDs)>0)