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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T21:07:38+00:00 2026-05-26T21:07:38+00:00

I have two very large tables, Table1 and Table2. They look like this: Table1

  • 0

I have two very large tables, Table1 and Table2. They look like this:

Table1 (800k records): Name, BirthDate, OrderNumber, col4, col5, col6.

Table2 (200k records): Name, BirthDate, OrderNumber, col4, col5, col6.

How can I select all records from table 1 which don’t have a matching Name, BirthDate, OrderNumber combination in table 2? The rest of the columns don’t matter.

I’ve tried doing this query below which runs for at least a couple minutes with no apparent end. Right now I am just trying to select the records then i can figure out how to combine the tables.

Select Table1.Name, Table1.BirthDate, Table1.OrderNumber from Table1
left join Table2 ON 
Table1.Name=Table2.Name AND
Table1.BirthDate=Table2.BirthDate AND
Table1.OrderNumber=Table2.OrderNumber AND 
WHERE Table2.Name IS NULL;
  • 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-26T21:07:38+00:00Added an answer on May 26, 2026 at 9:07 pm

    You can try this variation and see if it’s any better. You should also make sure you have Name, BirthDate and OrderNumber indexed.

    SELECT t1.Name, t1.BirthDate, t1.OrderNumber
        FROM Table1 t1
        WHERE NOT EXISTS(SELECT NULL
                             FROM Table2 t2
                             WHERE t2.Name = t1.Name
                                 AND t2.BirthDate = t1.BirthDate
                                 AND t2.OrderNumber = t1.OrderNumber)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a SQL database with two tables like this: Users Id (PK) Name
I have three large MySQL tables. They are approaching 2 million records. Two of
I have two very large enterprise tables in an Oracle 10g database. One table
I have a very large database (~100Gb) primarily consisting of two tables I want
I have a very large existing set of tables being replicated (transactional) between two
I have two very large tables and I need to process a small resultset
I have two tables with identical structure and VERY LARGE number of fields (about
I have two (very large) text files. What is the fastest way - in
I have two arrays, one is very large (more than million entries) and other
This is a very noobish question, so I apologize in advance! I have two

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.