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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T23:35:43+00:00 2026-06-17T23:35:43+00:00

I hope I can explain this correctly. Here it is: I have a list

  • 0

I hope I can explain this correctly. Here it is:

I have a list of id’s that I need to check in a mysql table against a subscription status to find out how many of those id’s are current. I have the id and the subscriptionEnd. My query is not working and I do not have enough knowledge to know how this would be done. Please review and share with me what I could do. There are thousands of id’s I need to match against.

SELECT c.id, c.subscriptionEnd
FROM subscriptions c
WHERE c.subscriptionEnd > '2013-01-27`
AND c.id = 12345
AND c.id = 12939
....

This list goes on and on and I see that this will not work. But the problem is I don’t know how to get this to work. Very much appreciated with any solutions on how I can check and get the results of the id’s that have a subscriptionEnd greater than the date given.

Thank you

  • 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-17T23:35:44+00:00Added an answer on June 17, 2026 at 11:35 pm

    Your best bet, since you have 1000’s of values to check against, is to insert all of the ids you want to check into a temporary table – let’s call the table checkIds with a single column id.

    Then you can simply do:

    SELECT c.id, c.subscriptionEnd
    FROM subscriptions c
    INNER JOIN checkIds ON c.id = checkIds.id
    WHERE c.subscriptionEnd > '2013-01-27'
    

    And finally drop the temporary table when you are done.


    Other solutions include:

    • A giant unwieldy IN clause which will probably be a performance nightmare:

      SELECT c.id, c.subscriptionEnd
      FROM subscriptions c
      WHERE c.subscriptionEnd > '2013-01-27'
      AND c.id IN (12345, 12939, ...)
      
    • Finding a pattern in your list of IDs:

      SELECT c.id, c.subscriptionEnd
      FROM subscriptions c
      WHERE c.subscriptionEnd > '2013-01-27'
      AND (c.id = 12345
          OR c.id BETWEEN 12939 AND 12951
          OR ...)
      
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I hope I can explain this right I have two input fields that require
I hope I can explain this well enough so that you can understand the
I hope I can explain this correctly. I am using the Javolution library to
Ok this is hard to explain, but here goes. I have a 3D list
OK, I hope I explain this one correctly. I have a struct: typedef struct
Hope I can explain this correctly.. Silverlight Application Telerik Reports (in a separate Class)
I hope I can explain this properly. I'm making an android app that, when
I hope I can explain this problem right, it's a bit confusing for me.
I hope I can explain this properly. I'm using flashDevelop for an avatar creation
I hope this I can explain what I am trying to achieve: I want

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.