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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T16:55:50+00:00 2026-06-13T16:55:50+00:00

I was given a database that is a little weird, but I am not

  • 0

I was given a database that is a little weird, but I am not able to change it. There is a field that is set as an array but holds ids that I need to access in where clauses. Here is the field set up:

TABLE: PROMOS
promo_id   |    contract_ids
-----------------------------
 1               23,34,54
 2               13,34,55
 3               20,30

I need to do an sql query to get all promo_ids where contract id = 34

mysql_query("SELECT promo_id FROM Promos WHERE contract_ids = '34'

Is there a way to do this?? Thanks for any help!

  • 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-13T16:55:51+00:00Added an answer on June 13, 2026 at 4:55 pm
    SELECT promo_id FROM Promos 
    WHERE FIND_IN_SET(34, contract_ids) > 0
    

    See FIND_IN_SET doc

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

Sidebar

Related Questions

Given a database that has numerous repeating columns used for auditing and versioning, what
I Have to get a movie from a PostgreSQL database that matches a given
Is there a way to query a MySQL database that gives me all blobs
My boss has given me an assignment that I'm not sure is possible since
I am currently querying our database using a rather lengthy statement, given how little
My question is a little vague at the moment since I'm not sure that
I have a field in my database that has 5 possible values: fair, good,
I want to get list of tables in a given database and a given
I would like to generate POJO, XML for a given database. Database: ( contents
Given a database with two tables X and Y , I have a query

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.