If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > Mysql find_in_set problem

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 09-17-09, 06:41
prasath03 prasath03 is offline
Registered User
 
Join Date: Aug 2009
Posts: 2
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.
Reply With Quote
  #2 (permalink)  
Old 09-17-09, 07:32
r937 r937 is offline
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,534
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
__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On