sql server - Get multiple id on multiple value in string with sql? -
i have 1 table like
tbl
--------------------- id users name --------------------- 1 2,3 acc1 2 4 acc2 3 2,4,1 acc3 4 4,1 acc4
in table want id , name users i.e user [2] have id , name
suppose pass user [2] result id 1 , 3 , name acc1 , acc3.
use like
function
select id, name yourtable (user = '2' or user '2,%' or user '%,2' or user '%,2,%')
Comments
Post a Comment