Subject Re: [firebird-support] How do I write this query
Author Helen Borrie
At 10:46 PM 2/06/2005 +1000, you wrote:
>Hi everyone,
>
>Could some one help me write the following SQL query, once I see the
>basics I will be on my way.
>
>I have 3 tables set up as such
>
>Table A <<<>>> Table B<<< >>> Table C
>
>Table B is the detail Table of A where Table A is the master table
>
>Table C is the detail Table of B where Table B is the master table
>
>ie all 3 tables are related
>
>I need to find all records in Table A where the record in Table C = a value

At its simplest:

select
a.field1, a.field2, a.....,
from TableA a
join TableB b on b.KeyToA = a.PriKey
join TableC c on c.KeyToB = b.PriKey
where c.SomeField = aValue

./heLen