Skip site navigation (1) Skip section navigation (2)

Re: [SQL] select with group by problem

From: <kaiq(at)realtyideas(dot)com>
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-17 15:26:13
Message-ID: Pine.LNX.4.10.9912170919030.26477-100000@picasso.realtyideas.com (view raw or flat)
Thread:
Lists: 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)
> 
> ************
> 


In response to

Responses

pgsql-sql by date

Next:From: nekoDate: 1999-12-17 15:55:55
Subject: Re: [SQL] select with group by problem
Previous:From: Stephan BauerDate: 1999-12-17 13:11:53
Subject: select with group by problem

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group