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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T03:33:02+00:00 2026-05-23T03:33:02+00:00

I am designing a query that pull rows from a large table based on

  • 0

I am designing a query that pull rows from a large table based on parameters expressed as ranges (specifically years). There are some cases where I’ll want to pull rows based on 3 specific values (say, pull customer records where customer number is #001, #002, and #003).

For the range question, I’m wondering if there is a syntax for the conditional behind the WHERE statement that works faster than the others:

IN()

BETWEEN()

high.range >= data >=low.range

For the IN() option, I could write a script that translate the years into a list of years from low.range to high.range inclusive. So, for the range 2000 to 2004, it would be IN(‘2000′,’2001′,’2002′,’2003′,’2004’). This would be an extra programming step outside of MySQL, but it’s not hard for me to do.

I realize that there are other things I can do to speed things up (like using a clustered index), but I just wanted to see if there is any difference from which sql syntax to use after the WHERE statement.

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

    behind the scenes between works just like high.range >= data >=low.range

    In(condition1, condition2, condition3) works just like (condition1 or condition2 or condition3)

    I’d expect between to work faster if the number of date is larger than 1 or 2.

    its like (1000 > 1001) versus (1000 = 998 or 1000 = 996 or 1000 = 995 etc).

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

Sidebar

Related Questions

While designing a table my colleague here says that I should avoid identity column
When designing user table what would be the must have fields from the security/user
I need help designing a query that will be used to return a website's
I have wrote universal script to get all rows from Doctrine Table Models, but
I have a query I'm designing which grabs data from multiple different tables. In
Designing a new system from scratch. I'll be using the STL to store lists
When designing a collection class, is there any reason not to implement locking privately
In designing any desktop applications, are there any general rules on how much memory
When designing a lookup table (enum) in SqlServer 2005, if you know the number
I am working with a SharePoint web part that I am designing in C#.

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.