SQL : in clause in stored procedure:how to pass values

前端 未结 8 1928
小蘑菇
小蘑菇 2020-11-27 18:12

I want to write a SQL Server 2005 stored procedure which will select and return the user records from the user table for some userids which are passed to the stored procedur

8条回答
  •  囚心锁ツ
    2020-11-27 18:52

    You can also use Find_IN_SET instead of IN. See the query below

    create procedure myproc(IN in_user_ids varchar(100)) 
    begin
       select * from users where FIND_IN_SET(userid, in_user_ids);
    end
    

提交回复
热议问题