Results 1 to 2 of 2
  1. #1
    Join Date
    Aug 2009
    Posts
    2

    Unanswered: Mysql find_in_set problem

    Dear All,

    Since find_in_set only searches by a single string, like:

    find_in_set('a', 'a,b,c,d');

    is there any way to achieve functionality like I would if find_in_set
    could search by multiple strings, such as:

    find_in_set('a,b,c', 'a,b,c,d');

    This would return true if a OR b OR c were found in the set 'a,b,c,d'.

    Thanks in Advance

    Prasath.

  2. #2
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    Code:
    WHERE FIND_IN_SET('a','a,b,c,d') > 0
       OR FIND_IN_SET('b','a,b,c,d') > 0
       OR FIND_IN_SET('c','a,b,c,d') > 0
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •