Re: Incorrect sort result caused by ROLLUP and WHERE operation

From: Zhang Mingli <zmlpostgres(at)gmail(dot)com>
To: pgsql-bugs <pgsql-bugs(at)lists(dot)postgresql(dot)org>, 谭忠涛 <zhongtao(dot)tan(at)seaboxdata(dot)com>
Subject: Re: Incorrect sort result caused by ROLLUP and WHERE operation
Date: 2025-01-02 10:49:26
Message-ID: c7363f1d-dcc3-4003-bd18-4f80af5be3d7@Spark
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Hi,

Zhang Mingli
www.hashdata.xyz

Do you mean order of null value (column a)  is wrong?
Use NULLS FIRST/LAST to order null values.
On Jan 2, 2025 at 18:19 +0800, 谭忠涛 <zhongtao(dot)tan(at)seaboxdata(dot)com>, wrote:
>
> Case:
> create table t1(a int, b int);
> insert into t1 values(1,1),(1,2);
> select a,b,sum(10) as s from t1 where a = 1 group by rollup(a,b) order by a, s desc;

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2025-01-02 15:53:01 Re: AW: Commit 5a2fed911a broke parallel query
Previous Message Rank, Christian (LfL) 2025-01-02 09:33:36 AW: Commit 5a2fed911a broke parallel query