declare @uids char(100)
set @uids='1725320,1725320';
SELECT *
FROM [Brand].[dbo].[Member_UserInfo]
where uid in (Select * From split(@uids, ','))
-----------下面是自定义函数,在使用的表中建立下就可以----------------
CREATE FUNCTION [dbo].[Split]
(
@c VARCHAR(MAX) ,
@split VARCHAR(50)
)
RETURNS @t TABLE ( col VARCHAR(50) )
AS
BEGIN
WHILE ( CHARINDEX(@split, @c) <> 0 )
BEGIN
INSERT @t( col )
VALUES ( SUBSTRING(@c, 1, CHARINDEX(@split, @c) - 1) )
SET @c = STUFF(@c, 1, CHARINDEX(@split, @c), '')
END
INSERT @t( col ) VALUES ( @c )
RETURN
END