Subject | Re: how to add subtotal |
---|---|
Author | adsieben |
Post date | 2007-08-22T10:56:50Z |
--- In firebird-support@yahoogroups.com, "bill2janesoft@..."
<bill2janesoft@...> wrote:
CREATE VIEW MasterView AS
SELECT key1, SUM( subtot )
FROM detail
GROUP BY key1
regards / liebe Grüße aus einem sonnigen Wien
Andre
<bill2janesoft@...> wrote:
>it in one sql.
> Hello,
> I think that this is a fairly common job, but I don't know how to do
> eg, in master/detail invoice tablesMaybe a view would be the solution
> table master has 2 fields (key1, tot)
> table detail has 3 fields (key1, linenum, subtot)
>
> I want to update all records in master so that
> each tot = sum(subtot) for master.key1=detail.key1
>
CREATE VIEW MasterView AS
SELECT key1, SUM( subtot )
FROM detail
GROUP BY key1
regards / liebe Grüße aus einem sonnigen Wien
Andre
> thanks in advance
>
> --
> regards,
> bill
>