Re: [SQL] select with group by problem

From: Vladimir Terziev <vlady(at)school(dot)digsys(dot)bg>
To: Stephan Bauer <stephan_bauer(at)gmx(dot)de>
Cc: pgsql-sql(at)postgresql(dot)org, Dietmar Kling <dietmar(dot)kling(at)sam-net(dot)de>
Subject: Re: [SQL] select with group by problem
Date: 1999-12-20 09:58:10
Message-ID: Pine.BSI.4.20.9912201157240.1054-100000@school.digsys.bg
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql


The problem is in function SUM. That function always returns not null
result as rows.

Regards!

Vladimir

On Fri, 17 Dec 1999, Stephan Bauer wrote:

> Hello,
>
> could anyone tell me why the second select statement returns one row.
>
> regards
>
> Stephan
>
> xtra=> select * from
> warenkorb;
> cookie|datum|artnr|artnr1|artnr2|artikelname|farbe|groesse|menge|preis
> ------+-----+-----+------+------+-----------+-----+-------+-----+-----
> (0 rows)
>
> xtra=> SELECT artnr, artnr1, artnr2, artikelname, farbe, groesse, SUM(
> menge ),
> preis FROM warenkorb WHERE cookie = 'asdfasdf' GROUP BY artnr, artnr1,
> artnr2,
> artikelname, farbe, groesse, preis;
> artnr|artnr1|artnr2|artikelname|farbe|groesse|sum|preis
> -----+------+------+-----------+-----+-------+---+-----
> | | | | | | |
> (1 row)
>
> ************
>
>

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Dan Linderman 1999-12-20 15:00:37 Inheriting Primary Keys
Previous Message Gerhard Dieringer 1999-12-20 09:30:10 Antw: Re: [SQL] group by / having