Subject Re: SQL design question
Author ac.hi@switzerland.org
> > I will make my question clear with an example : I have 2
> tables with a me data like this :
> >
> > Table1 Table2
> > ----------------------------------
> > LAS LAS
> > DRA DRA
> > COL COL
> > SNY <--- That's the record I
> would like to retrieve....
> >
> select * from Table2
> where not exists
> (select * from Table1
> where Table1.Col1 = Table2.Col2)
>

Another way to do it would be:

select * from Table2 left join Table1 on Table2.Col2 = Table1.Col1
where Table1.Col1 is null

Try by yourself which of the two queries is faster.

Daniel Achermann