Re: Incorrect sort result caused by ROLLUP and WHERE operation
Zhang Mingli <zmlpostgres@gmail.com>
From: Zhang Mingli <zmlpostgres@gmail.com>
To: pgsql-bugs <pgsql-bugs@lists.postgresql.org>, 谭忠涛 <zhongtao.tan@seaboxdata.com>
Date: 2025-01-02T10:49:26Z
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.tan@seaboxdata.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;