Re: [SQL] select with group by problem - Mailing list pgsql-sql

From
Subject Re: [SQL] select with group by problem
Date
Msg-id Pine.LNX.4.10.9912170919030.26477-100000@picasso.realtyideas.com
Whole thread Raw
In response to select with group by problem  (Stephan Bauer <stephan_bauer@gmx.de>)
Responses Re: [SQL] select with group by problem
Re: [SQL] select with group by problem
List pgsql-sql
because there is a sum. sum always results something, even
the something's value is a null ;-)


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)
> 
> ************
> 



pgsql-sql by date:

Previous
From: Stephan Bauer
Date:
Subject: select with group by problem
Next
From: neko@kredit.sth.szif.hu
Date:
Subject: Re: [SQL] select with group by problem