开发者

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', ',')
       )
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜