Home > mysql, Php programming > Difference between IN and FIND_IN_SET

Difference between IN and FIND_IN_SET

Hello Friends,

You may be confused with IN() and FIND_IN_SET() MYSQL functions. There are specific case/situation for both functions where to use which Mysql function. Look at below explanation about IN() and FIND_IN_SET().

IN() : This function is used when you have a list of possible values and a single value in your database.
Example: WHERE memberid IN (1,2,3)

FIND_IN_SET() : This function is used where you have comma separated list of values stored in database and want to see if a certain value exists in that comma seperated list.
Example: WHERE FIND_IN_SET( ‘Bhavin’, namelist )

Advertisements
Categories: mysql, Php programming Tags: ,
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: