List:General Discussion« Previous MessageNext Message »
From:Baron Schwartz Date:October 26 2007 3:42pm
Subject:Re: Comparing keys in two tables
View as plain text  
Aaron Fischer wrote:
> Greetings!
> 
> I have a problem that it seems would best be solved using subqueries.  
> However, I am working on a server that is running MySQL 3.23.58, so 
> subqueries are not available to me.
> 
> What I am trying to do:
> I have two tables, each containing approximately 37,000 records.  I want 
> to compare the index field in Table A to the index field in Table B.  I 
> would like to see all records where the index in Table A does not exist 
> in Table B.

Use an "exclusion join:"

SELECT ...
FROM tblA
    LEFT OUTER JOIN tblB ON col=col
WHERE tblB.col IS NULL;

Baron
Thread
Comparing keys in two tablesAaron Fischer26 Oct
  • Re: Comparing keys in two tablesBaron Schwartz26 Oct
  • Re: Comparing keys in two tablesPeter Brawley26 Oct
    • Re: Comparing keys in two tablesAaron Fischer26 Oct
      • Re: Comparing keys in two tablesBaron Schwartz26 Oct
        • Re: Comparing keys in two tablesRob Wultsch26 Oct
          • Re: Comparing keys in two tablesBaron Schwartz26 Oct
      • Re: Comparing keys in two tablesPeter Brawley26 Oct
  • Re: Comparing keys in two tablesmysql26 Oct