Re: [HACKERS] Group By, NULL values and inconsistent behaviour.

Поиск
Список
Период
Сортировка
От Michael J. Maravillo
Тема Re: [HACKERS] Group By, NULL values and inconsistent behaviour.
Дата
Msg-id Pine.LNX.3.96.980127001728.25414A-100000@fiesta.philonline.com.ph
обсуждение исходный текст
Ответ на Re: [HACKERS] Group By, NULL values and inconsistent behaviour.  (darrenk@insightdist.com (Darren King))
Ответы Re: [HACKERS] Group By, NULL values and inconsistent behaviour.  (The Hermit Hacker <scrappy@hub.org>)
Список pgsql-hackers
On Mon, 26 Jan 1998, Darren King wrote:

>> The following is Informix behavior:
>>
>> > select b,c,sum(a) from t1 group by b,c;
>> b  c             (sum)
>>
>>    x                 5
>>    z                 3
>>
>> 2 row(s) retrieved.
>
>Here is where postgres seems to differ.  Seems postgres is missing
>an implicit sort so that the grouping is done properly.
>
>Postgres will return _three_ rows...
>
>b  c      (sum)
>   x          3
>   z          3
>   x          2

I'm running the current cvs and it gives me this.

select b,c,sum(a) from t1 group by b,c;
b|c |sum
-+--+---
 |x |  1
 |x |  2
 |z |  3
 |x |  2
(4 rows)

>> > select b,c,sum(a) from t1 group by b,c order by c;
>> b  c             (sum)
>>
>>    x                 5
>>    z                 3
>>
>> 2 row(s) retrieved.
>
>Even with the order by, postgres still returns _three_ rows...
>
>b  c       (sum)
>   x           3
>   x           2
>   z           3

select b,c,sum(a) from t1 group by b,c order by c;
b|c |sum
-+--+---
 |x |  1
 |x |  2
 |x |  2
 |z |  3
(4 rows)

>For now, ignore the patch I sent.  Appears from Andreas demo that the
>current postgres code will follow the Informix style with regard to
>grouping columns with NULL values. Now that I really think about it,
>it does make more sense.

I think I saw the patch committed this morning...?


Mike
[ Michael J. Maravillo                                 Philippines Online ]
[ System Administrator     PGP KeyID: 470AED9D     InfoDyne, Incorporated ]
[ http://www.philonline.com/~mmj/                          (632) 890-0204 ]


В списке pgsql-hackers по дате отправления:

Предыдущее
От: darrenk@insightdist.com (Darren King)
Дата:
Сообщение: Re: [HACKERS] Group By, NULL values and inconsistent behaviour.
Следующее
От: The Hermit Hacker
Дата:
Сообщение: Re: [HACKERS] Group By, NULL values and inconsistent behaviour.