Subject | Re: [ib-support] alternatives to "where X not in..." |
---|---|
Author | Helen Borrie |
Post date | 2003-05-26T08:35:24Z |
At 10:27 AM 26/05/2003 +0200, you wrote:
from sometable a
left join thistable b
on a.thisfield = b.thisfield
where b.thisfield is null
heLen
>Hi list,select a.fieldx, b.coly, ..., b.thisfield
>
>I found that an SQL statement like:
>
> select somefields
> from sometable
> where thisfield not in (select thistfield from thistable)
>
>is really slow when the tables have a high number of records. So is there
>any better alternative to this? (joins work well when the statement is
>"where X in", but how to do the same in a "not in" case?)
from sometable a
left join thistable b
on a.thisfield = b.thisfield
where b.thisfield is null
heLen