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

  • Home
  • SEARCH
  • 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 817003
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T01:55:31+00:00 2026-05-15T01:55:31+00:00

I wanted to search through multiple rows and obtain the row that contains a

  • 0

I wanted to search through multiple rows and obtain the row that contains a particular item.

The table in mySQL is setup so each id has a unique list (comma-delimited) of values per row.

Ex:

id | order
1  | 1,3,8,19,34,2,38
2  | 4,7,2,190,38

Now if I wanted to pull the row that contained just the number 19 how would I go about doing this? The possibilities I could figure in the list with a LIKE condition would be:

19,     <-- 19 at the start of the list
,19     <-- 19 at the end of the list
,19,    <-- 19 inside the list

I tried the following and I cannot obtain any results, Thank you for your help!

SELECT *
FROM categories
WHERE order LIKE '19,%' OR '%,19%' OR '%,19%'
LIMIT 0 , 30
  • 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-15T01:55:32+00:00Added an answer on May 15, 2026 at 1:55 am

    You can use FIND_IN_SET to solve your problem in a simpler way:

    SELECT *
    FROM categories
    WHERE FIND_IN_SET('19', `order`)
    LIMIT 0, 30
    

    In general though you should try to design your database so that this type of operation is not necessary.

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

Sidebar

Related Questions

I have tried to use mysql fulltext search in my intranet. I wanted to
lets say I wanted to search through divs with a certain class name.and if
Say I wanted to invoke the following url that returns Json through an Ajax
I am using Cakephp to perform a search through sphinx. I wanted to do
I wanted to create a search add-on to right click and search tag text
Let's say you wanted to implement a breadth-first search of a binary tree recursively
I have a image button. I wanted to add a text Search on it.
Sorry if this question has been asked before. On my search through SO I
Objective: Search through an array of tens of thousands of Chinese sentences in order
I'm trying to use a LIKE statement to search through a number of columns.

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.