Subject Re: [firebird-support] SQL NOT IN
Author Alexandre Benson Smith
Dion wrote:

>select fetchedhrs.forkliftcell
>
> from fetchedhrs
>
> where fetchedhrs.forkliftcell not in
>
> (select forklift.forkliftcell from forklift)
>
>
>
>Hi,
>
>
>
> 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 is
>at least one record in the FetchedHrs table which is not in the Forklift
>table.
>
>
>
>Is there an issue with this in FB v1.5.2.4731?
>
>
>
>Thanks,
>
>Dion.
>
>
>
Hi Dion,

The above query lookslike ok !

try this one to check

select
A.forkliftcell
from
fetchedhrs A left join
forklift B on (B.forkliftcell = A.forkliftcell)
where
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
Development
THOR Software e Comercial Ltda
Santo Andre - Sao Paulo - Brazil
www.thorsoftware.com.br