Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6738047
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T11:19:15+00:00 2026-05-26T11:19:15+00:00

I am trying to find all occurrences of a string in a field using

  • 0

I am trying to find all occurrences of a string in a field using the IN command but not returning any results when I know there should be some.
I think the best way to show you is by example:

mysql> SELECT detail_sections FROM inet_staff_details WHERE detail_sections !='';
+-----------------+
| detail_sections |
+-----------------+
| 10,11           |
| 10,11           |
| 10,11           |
| 10,11           |
+-----------------+
4 rows in set (0.00 sec)

mysql> SELECT * FROM inet_staff_details WHERE 11 IN (detail_sections);
Empty set, 4 warnings (0.00 sec)

mysql> SELECT * FROM inet_staff_details WHERE '11' IN (detail_sections);
Empty set (0.00 sec)

As you can see, the number 11 is in the comma separated list but does not show up in the results. Please can you advise what I am doing wrong?

Cheers.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T11:19:15+00:00Added an answer on May 26, 2026 at 11:19 am

    Try this query –

    SELECT * FROM inet_staff_details WHERE FIND_IN_SET(10, detail_sections);
    

    FIND_IN_SET function.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to find the positions of all occurrences of a string in another
I am trying to extract all occurrences of tagged words from a string using
I am trying to find offset of all occurrences with preg_match_all e.g. $haystack =
I'm trying to find all Users with an id greater than 200, but I'm
I'm trying to find all permutations of a string and sort them alphabetically. This
I'm trying to use Notepadd++ to find all occurrences of width=xxx so I can
I'm trying to find all the hash tags in a string. The hashtags are
What I'm trying to do is find all matches in a string, then wrap
I am trying find all the users that are not in a friends user
Trying to find all HTML <table> rows with this operator, but nothing: preg_match_all(#<tr[^>]*>.*</tr>#, $content,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.