Back to Top

Mysql String Function FIND_IN_SET( )

findinset in mysql

Before someday, I have used MySQL function for fetching category from some the categories and I really like this function.It reduces the use of some complex queries.You should also like New Features in MySQL 5.6.

One of the very important MySQL string function is FIND_IN_SET and its returns the position of a string value if it is available (as a substring) within a string. String contain comma separated characters or values.

Share:
Share on Facebook2

Share on LinkedIn0Tweet about this on TwitterShare on Google+2Buffer this pageDigg thisShare on Reddit0

Comments (19)

  1. What will the function return if the string is to be found at the first position? 0 or 1? If it’s 0 then how do you distinguish it from the 0 where nothing is found?

    1. It will return 1 for first match, execute below queries and you will get your answer.

      SELECT FIND_IN_SET('4','4,5,6,7');
      SELECT FIND_IN_SET('4','5,4,6,7');

      1. Good job mikang it appear easy.

      2. You know what, I’m very much ilnicned to agree.

    2. YMMD with that ansewr! TX

      1. The forum is a brhgiter place thanks to your posts. Thanks!

  2. This artlice keeps it real, no doubt.

    1. Heck of a job there, it aobsluetly helps me out.

      1. Hey! I just wish to give a huge tubmhs up for the nice data you have got right here on this post. I might be coming back to your weblog for more soon.

  3. Could you write about Physics so I can pass Scincee class?

    1. Great isnihgt. Relieved I’m on the same side as you.

  4. I smlipy couldn’t depart your website before suggesting that I really loved the usual information an individual supply on your visitors? Is gonna be again continuously to inspect new posts.

  5. We absolutely love your blog and find most of your post’s to be just what I’m looking for. can you offer guest writers to write content for yourself? I wouldn’t mind producing a post or elaborating on a few of the subjects you write about here. Again, awesome weblog!

  6. Kristeen Kroninger says:

    Respect to the post author. This is truly some interesting information.

  7. Wow, marvelous blog layout! How long have you been blogging for? you make blogging look easy. The overall look of your web site is wonderful, let alone the content!. Thanks For Your article about Mysql String Function FIND_IN_SET() | Creative Dev .

  8. Good one particular weblog operator triumph webpage publish wonderful sharings in such a blog site always have fun

  9. I just want to tell you that I am new to blogging and seriously liked you’re page. Likely I’m planning to bookmark your blog post . You amazingly have awesome well written articles. Many thanks for sharing your website.

  10. Great post at Mysql String Function FIND_IN_SET() | Creative Dev. I was checking constantly this blog and I am impressed! Very useful information specifically the last part 🙂 I care for such information much. I was looking for this particular information for a very long time. Thank you and best of luck.

  11. I am using

    SELECT p.* FROM products AS p
    JOIN cats AS c
    ON p.cat=12 AND FIND_IN_SET(123, c.prId_relate)=0

    // run Not match records

Leave a Reply

Your email address will not be published. Required fields are marked *

Most Popular Posts

How to Get local time using EarthTool

Posted on 3 years ago

Bhumi

How to Use PHP Sessions to Store Data

Posted on 7 months ago

Bhumi

How to Use PHP CodeSniffer?

Updated 17 years ago

Bhumi

AWS Cloud Database Migration Service

Updated 17 years ago

Bhumi

How does CI/CD works on AWS?

Updated 17 years ago

Bhumi

Overview of Amazon Web Services (AWS)

Updated 17 years ago

Bhumi

The Reader’s Poll – June 2015

Posted on 1 year ago

Bhumi

The Reader’s Poll – August 2014

Posted on 2 years ago

Bhumi

The Reader’s Poll – June 2014

Posted on 2 years ago

Bhumi

The Readers’ Poll – May 2014

Posted on 2 years ago

Bhumi

The Readers’ Poll – August 2013

Posted on 3 years ago

Bhumi