Select from table with multiple values
My query is
SELECT *
FROM tblalumni_member
WHERE username IN ( SELECT *
FROM 开发者_运维技巧Split('ramesh,sagar,pravin', ',') )
AND Is_Approved = 1
and username field contains multiple values separated by comma. Like ramesh,sachin,pravin
.
It should give all rows if any of get matched in selected result.
Can you please help me?In case of SQL Server perhaps something like
SELECT *
FROM tblalumni_member m
WHERE Is_Approved = 1 AND
EXISTS(
SELECT * FROM Split(m.username, ',')
INTERSECT
SELECT * FROM Split('ramesh,sagar,pravin', ',')
)
精彩评论