Subject RE: [firebird-support] SQL NOT IN
Author Rick Debay
> Wouldn't it be the same as the original query ?

It would perform differently. I know this from experience as the IN
gets evaluated every time, and when I changed to an EXISTS the speed
increased dramatically.

-----Original Message-----
From: firebird-support@yahoogroups.com
[mailto:firebird-support@yahoogroups.com] On Behalf Of Alexandre Benson
Smith
Sent: Tuesday, November 22, 2005 9:50 AM
To: firebird-support@yahoogroups.com
Subject: Re: [firebird-support] SQL NOT IN

Lucas Franzen wrote:

>Dion schrieb:
>
>
>>select fetchedhrs.forkliftcell
>>
>> from fetchedhrs
>>
>> where fetchedhrs.forkliftcell not in
>>
>> (select forklift.forkliftcell from forklift)
>>
>>
>
>
>select fetchedhrs.forkliftcell
>from fetchedhrs
>WHERE NOT EXISTS
> ( SELECT * from forklift
> WHERE FETCHEDHRS.FORKLIFTCELL = FORKLIFT.FORKLIFTCELL )
>
>
>(sorry for any typo)
>
>Luc.
>
>
Hi Luc !

Wouldn't it be the same as the original query ? (Because IN is converted
to EXISTS internally)

I think you suggestion should work as the original query should work
too.

see you !

--
Alexandre Benson Smith
Development
THOR Software e Comercial Ltda
Santo Andre - Sao Paulo - Brazil
www.thorsoftware.com.br




++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Visit http://firebird.sourceforge.net and click the Resources item
on the main (top) menu. Try Knowledgebase and FAQ links !

Also search the knowledgebases at http://www.ibphoenix.com

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Yahoo! Groups Links