0

The following query works good.

SELECT FIND_IN_SET('b','a,b,c,d');
// output -> 2

I need to fetch the record having multiple options. Just for an example,

SELECT FIND_IN_SET('b,c','a,b,c,d');
// output -> ??????????

Please how do i get the record with multiple selection option "b,c" in "a,b,c,d".

Ashok
  • 128
  • 1
  • 8

1 Answers1

0

mysql function find_in_set can search only for one string in a set of strings.

the second its not a string in set of strings

take a look here

edit:

to change the mode

This can be done in two ways...

1- Open your "my.ini" file within the MySQL installation directory, and look for the text "sql-mode".

Find:

Code:

Set the SQL mode to strict sql-mode="STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION"

Replace with:

Code:

Set the SQL mode to strict sql-mode="NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION"

Or

2- You can run an SQL query within your database management tool, such as phpMyAdmin:

Code:

 SET @@global.sql_mode= '';
Community
  • 1
  • 1
echo_Me
  • 37,078
  • 5
  • 58
  • 78