Re: How to get single raws for sums in a summary table?

From: "A(dot) Kretschmer" <andreas(dot)kretschmer(at)schollglas(dot)com>
To: pgsql-novice(at)postgresql(dot)org
Cc: nasr(dot)laili(at)tin(dot)it
Subject: Re: How to get single raws for sums in a summary table?
Date: 2006-11-22 13:19:14
Message-ID: 20061122131914.GA25702@a-kretschmer.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

am Wed, dem 22.11.2006, um 1:50:05 +0100 mailte Ennio-Sr folgendes:

Your desired result my be wrong, for instance for titolo aaa:

>
> cod_rif | titolo | quantity | cmf | u_qq | mont | vend
> ---------+--------+----------+---------+--------+---------+------
> 7 | aaa | 2500 | 25.455 | 0 | 60.0897 | f
> 26 | aaa | -1000 | 6.11098 | 6.176 | 6.1110 | t
>
> The 'summary table' should look more or less like this:
>
> cod_rif | titolo | quantity | cmf | u_qq | mont | vend
> ---------+--------+----------+---------+--------+---------+------
> any | aaa | 1500 | 25.455 | 6.176 | 60.0897 | f

quantity: 2500 + -1000 = 1500, okay
cmf : 25.455 + 6.11098 != 25.455, wrong
u_qq : 0 + 6.176 = 6.176, okay
mont : 60.0897 + 6.1110 != 60.0897, wrong

> Do you have any suggestion to achieve the result I want?

No, because i can't see a regular way or rule to calculate this...

Andreas
--
Andreas Kretschmer
Kontakt: Heynitz: 035242/47215, D1: 0160/7141639 (mehr: -> Header)
GnuPG-ID: 0x3FFF606C, privat 0x7F4584DA http://wwwkeys.de.pgp.net

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Richard Broersma Jr 2006-11-22 14:53:32 Re: How to get single raws for sums in a summary table?
Previous Message Paefgen, Peter (LDS) 2006-11-22 12:50:25 Re: How to get single raws for sums in a summary table?