Subject RE: [firebird-support] SQL NOT IN
Author Dion
Strange thing is, if I run the following script

select fetchedhrs.forkliftcell

from fetchedhrs

where EXISTS

(select * from forklift)

records not actually in the forklift table, but in the fetchedhrs table,
are returned as part of the result dataset


[] On Behalf Of Alexandre Benson
Sent: 22 November 2005 04:22 PM
Subject: Re: [firebird-support] SQL NOT IN

Dion wrote:

>select fetchedhrs.forkliftcell
> from fetchedhrs
> where fetchedhrs.forkliftcell not in
> (select forklift.forkliftcell from forklift)
> I want all forklifts for which I have records in the FetchedHrs table but
>no corresponding record in the Forklift table. I thought that the above sql
>would work, but I get an empty resultant dataset. I am certain that there
>at least one record in the FetchedHrs table which is not in the Forklift
>Is there an issue with this in FB v1.5.2.4731?
Hi Dion,

The above query lookslike ok !

try this one to check

fetchedhrs A left join
forklift B on (B.forkliftcell = A.forkliftcell)
B.forkliftcell is null

if it returns an empty result set you have a full relation of the too tables
(i.e. no
fetchedhrs without forklift)

see you !

Alexandre Benson Smith
THOR Software e Comercial Ltda
Santo Andre - Sao Paulo - Brazil


Visit and click the Resources item
on the main (top) menu. Try Knowledgebase and FAQ links !

Also search the knowledgebases at




* Visit your group "firebird-support
<> " on the web.

* To unsubscribe from this group, send an email to:

* Your use of Yahoo! Groups is subject to the Yahoo!
<> Terms of Service.


[Non-text portions of this message have been removed]