Subject | Re: SQL design question |
---|---|
Author | ac.hi@switzerland.org |
Post date | 2001-06-07T02:55:02Z |
> > I will make my question clear with an example : I have 2Another way to do it would be:
> 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)
>
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