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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T20:28:17+00:00 2026-05-27T20:28:17+00:00

I am building an application based on MySQL that allows users to search for

  • 0

I am building an application based on MySQL that allows users to search for some facilities. The facilities are stored in one TEXT column and they are represented as “|”-separated field. Here is the example:

1|2|3|5|6|10|11|12|13|15|17|18|20|21|27|29|30|31|3...

Do you have any idea how I can implement efficient searching for facilities in MySQL? Let’s assume that we need to retrieve all rows that “contain” facilities 1, 2 and 15, what would be the query/method? I was trying to use Full-Text indexes but without any luck.

  • 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-27T20:28:18+00:00Added an answer on May 27, 2026 at 8:28 pm

    There is no way to search a symbol-separated string for a given value efficiently.

    The best way to improve efficiency in SQL is to use indexes, but you can’t use indexes to help find substrings.

    The best way to optimize your scenario is to create a child table with a single indexed INT column, and store each of your numeric values on a separate row. Then you can search it efficiently with the aid of the index.

    See also my answer to Is storing a comma separated list in a database column really that bad?

    Regarding matching multiple facilities when they’re stored on separate rows, I’ve added the sql-match-all tag which is used on Stack Overflow for that type of problem. It comes up frequently, and there are lots of good answers already. Click the tag to find them.

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

Sidebar

Related Questions

I'm building an Android application that's based around an enhanced WebView (based on PhoneGap).
I'm building a simple web based forum application. I want to allow users to
I'm currently working on a project that is building a java-based desktop application to
I'm building a .NET CF 3.5 application that will communicate with an server based
I am building application that required some data from iPhone's Call log(read only). The
I'm building an Android application which has to sent some information to my mysql
I am building an application that is based on MVVM-Light. I am in the
Im building an application that requires extensive logging of actions of the users, payments,
We're building an application designed to run on Windows-based servers. One of the considerations
I'm on a team that's currently building a MOSS 2007 based application (which relies

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.