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 9154741
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T12:28:34+00:00 2026-06-17T12:28:34+00:00

I have fetching record from table named Pizza_Table . Pizza_table Schema id | pizza

  • 0

I have fetching record from table named Pizza_Table.

Pizza_table Schema

id | pizza name | pizza_topping_ids
1  | pizza1     |1,2,3
2  | pizza2     |2,3
3  | pizza3     |4,5,6

Actually my functionality is searching pizza based on pizza_topping_ids
I have work allot in this searching. but I can’t find proper solution. .

I can’t use IN clause for fetching record.

I have tried out :

1)

 SELECT * 
 FROM `pizza_table` 
 WHERE `pizza_topping_id` REGEXP '[[:<:]]2[[:>:]]'

Problem : fetch all record having value 2

2)

SELECT * 
FROM `pizza_table` 
WHERE `pizza_topping_id` REGEXP '[[:<:]]1,2,3,4[[:>:]]' 

but MySQL returned an empty result set,

If comma separated values are not match to any record then return result which is most having value in topping_id column.

EX: If i have run above query for find out pizza having 1,2,3,4 topping_id, but In database no pizza exist having such topping_id combination then result will be most covered id should be displayed like ‘pizza1’ having pizza_topping_id 1,2,3.

Sorry for bad English as well as format, but try to understand my problem.
Thanks in advance.

Please help me.

  • 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-06-17T12:28:35+00:00Added an answer on June 17, 2026 at 12:28 pm

    Just try this-

    SELECT * FROM `pizza_table` WHERE  FIND_IN_SET(2,pizza_topping_id)
    

    OR REGEXP

    SELECT * FROM `pizza_table` WHERE pizza_topping_id REGEXP '^2,|,2$|,2,' OR pizza_topping_id =2
    

    Please see the demo : demo

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

Sidebar

Related Questions

I have a table and from that I am fetching records somewhere around 250,000
I have table from which I am fetching records for two time interval as
Let say i have 100k records in table, after fetching that records from table
I have a NSFetchedResultsController which is fetching objects from a NSManagedObjectContext . These objects
I have an App using UITableViews and fetching data from a server. I am
I am fetching data from multiple table having 600 thousand of records. But is
I am fetching records from MySQL database using Java (JDBC). I have tables -
I have an HTML table to display a set of records from database after
I have a CGI page with a table which is populated by fetching the
I have an problem in fetching records from database with php. I have 31700

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.