List:General Discussion« Previous MessageNext Message »
From:Paul DuBois Date:July 8 1999 2:37pm
Subject:Re: Left Join
View as plain text  
At 3:30 PM +0100 7/8/99, A. Brandic wrote:
>Trying to select records that exist in tableA but do not exist in tableB.
>select * from tableA LEFT JOIN tableB ON where
>now, id is a primary key in both tables and it is integer not null.
>This query gives me an empty set but whereas I'm expecting 73 records
>which exist in tableA but not in tableB.
>Where m I making a mistake?

You can't use "=" to test for NULL.  Try IS NULL instead:

select * from tableA LEFT JOIN tableB ON where is null;

Paul DuBois, paul@stripped
Northern League Chronicles:
Japanese supportBruno A Posokhow8 Jul
  • Left JoinA. Brandic8 Jul
    • Re: Left JoinPaul DuBois8 Jul
      • Re: Left JoinA. Brandic8 Jul
  • Re: Japanese supporttakeshi8 Jul