Subject Re: [firebird-support] master/detail select
Author Helen Borrie
At 12:15 PM 27/08/2003 +0200, you wrote:
>Helo!
>
>I want to make a selection from master/detail tables.
>
>as an example master table is A and detail is B
>
>i want to select some data from A and make a sum of a filed from B.
>Result will be made in one select.
>
>How to make this??

select A.PK, A.field2, A.fieldx,
(select sum(B.Numberfield) from B
where B.FK = A.FK
and B.Numberfield is not null) AS BTotal
from A

heLen