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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T03:03:56+00:00 2026-05-24T03:03:56+00:00

Is there a way to do something like this? SELECT * FROM tablename WHERE

  • 0

Is there a way to do something like this?

SELECT * FROM tablename WHERE x CONTAINS "1"

Basically, I want to select data from the database where x contains a specific number. The thing is, the x column in any row could contain “1, 2, 3” and I want to select all those that contain 1, specifically 1, not 11 or anything that contains 1, but specifically a 1.

Here’s an example:

id   title   x
-------------------
1    row1    1,22,3
2    row2    1,5
3    row3    5,91
4    row4    70

And I want my query to return rows 1 and 2. I don’t want row 3, as the 1 is inside the number 91. I don’t want row 4 because there’s no 1 there either.

  • 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-24T03:03:57+00:00Added an answer on May 24, 2026 at 3:03 am

    You can use the FIND_IN_SET function like so:

    SELECT * FROM tablename WHERE FIND_IN_SET('1', x)
    

    This will also get optimised to use bit arithmetic if you are calling it on a SET type.

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

Sidebar

Related Questions

In Ant is there any way to do something like this: <arguments id=arg-list> <arg
Is there a way in java to do something like this: void fnc(void Reference_to_other_func());
Is there any way to crate nested union types in F#? Something like this
I'm trying to do something like this : select * from table where not
In plain old SQL, I can do something like this: select * from mytable
I'm trying do something like this: SELECT * FROM table WHERE column IN (1,2,3)
my query is something like this Select date_value from Tab1; The output looks like
Is there a way to do something like this without converting the sql to
I have a query which contains a subquery which is something like this IFNULL((SELECT
Is there a way to specify a mysql query that does something like this

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.