Subject | Re: [IBO] Silly question .. hopefulle somebody can help |
---|---|
Author | Helen Borrie |
Post date | 2005-10-29T09:08:24Z |
At 10:50 AM 29/10/2005 +0200, you wrote:
from animals a1
where exists (
select 1 from animals a2
where a2.damid = a1.animalid)
SQL puzzles don't belong here, btw - take them to firebird-support.
Helen
>Hiselect a1.animalid, a1.animalname
>Ive got IB_Query with List of animals.
>Key field ANIMALID, DAMID, ANIMALNAME
>The DAMS(mothers) are linked to their calves by DAMID
>
>The DAMID of a record = the ANIMALID of the Dam.
>
>Now I need a list of all animals that have calved.
>
> How do I get a query for a reporting tool, with the resultset reflecting
>only the animals that have calved, but without duplictes that result from a
>JOIN.
from animals a1
where exists (
select 1 from animals a2
where a2.damid = a1.animalid)
SQL puzzles don't belong here, btw - take them to firebird-support.
Helen