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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T06:26:13+00:00 2026-05-23T06:26:13+00:00

I have a query to list a set of numbers, for example 1000000 through

  • 0

I have a query to list a set of numbers, for example 1000000 through 2000000, I then run another query in that while loop to see if it matches another table in another database. This part runs fine, but a little slow.

I then need to have another query such that if it returns false, then it does another check on yet another table. The problem I’m having though, is that the check in this table is not as simple as a match.

The table structure on last table is like this:

  • firstnum
  • secondnum

This is intended for use in a range of numbers. So row 1 for example might be:

1000023, 1000046

This would mean it’s for all numbers between and including those values.
There are thousands of these entries in the DB, and I’m trying to figure out the best way to determine if that particular number I’m searching on exists in that table somewhere, but since it’s not a direct match, I’m not sure how to accomplish this. The table is also PostgreSQL while the main queries are MySQL.

  • 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-23T06:26:14+00:00Added an answer on May 23, 2026 at 6:26 am

    It’s a bit hard to understand what you’re trying to say, but I’m afraid the solution is ridiculously simple: ... WHERE firstnum <= X AND X <= secondnum, where X is the number you are looking for.

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

Sidebar

Related Questions

I have a query that is dynamically built after looking up a field list
I have a query that looks like this: it takes a list of IDs
For example I have such query: Query q = sess.createQuery(from Cat cat); List cats
I have a query that works: DECLARE @ProductID int SET @ProductID = '1234' SELECT
I have a list of ID numbers that I pull from a session variable
i have the following query to list the employees of two table. i need
I have the following LINQ query: List<string> Types = (List<string>)Directory.GetFiles(@C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727) .Where(x => System.IO.Path.GetFileNameWithoutExtension(x).Contains(Microsoft)) .ToList<string>();
I have a query which produces a list of orders like this: Invoice Description
I have a asp.net page where i query a list of url and the
I have a LINQ query to a DataTable : var list = from row

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.