Always one row with group by / agregate

Started by Alain TESIOover 26 years ago2 messagesbugs
Jump to latest
#1Alain TESIO
tesio@easynet.fr

dip=> create table t ( x int , y int );
CREATE
dip=> select x,min(y) from t group by x;
x|min
-+---
|
(1 row)

select min(y) should return one row with a null value, but it's
expected. I thought that the first part of the job was to process
the group by and then the select on each group, but it doesn't
seem to be the case.

Alain

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Alain TESIO (#1)
Re: [BUGS] Always one row with group by / agregate

"Alain TESIO" <tesio@easynet.fr> writes:

dip=> select x,min(y) from t group by x;
x|min
-+---
|
(1 row)

Yup, that's a bug --- with GROUP BY, no rows in should yield no groups
and hence no rows out. It's fixed for the next release.

regards, tom lane