Re: order by
| От | Ron |
|---|---|
| Тема | Re: order by |
| Дата | |
| Msg-id | 4c0e1dd6-37a1-9712-e7af-0406fab32d72@gmail.com обсуждение |
| Ответ на | order by (Marc Millas <marc.millas@mokadb.com>) |
| Список | pgsql-general |
On 5/11/23 09:29, Marc Millas wrote:
This doesn't answer your question, but: ORDER BY has NULLS { FIRST | LAST } options, so no need to completely change the sort order.
And this just confuses your question:
https://www.postgresql.org/docs/15/sql-select.html
Hi,I keep on investigating on the "death postgres" subjectbut open a new thread as I don't know if it's related to my pb.I have 2 different clusters, on 2 different machines, one is prod, the second test.Same data volumes.On prod if I doselect col_a, count(col_a) from table_a group by col_a order by col_a desc,I get the numbers of NULL on top.To get the number of NULL on top on the test db, I have toselect col_a, count(col_a) from table_a group by col_a order by col_a asc.
This doesn't answer your question, but: ORDER BY has NULLS { FIRST | LAST } options, so no need to completely change the sort order.
And this just confuses your question:
https://www.postgresql.org/docs/15/sql-select.html
IfNULLS LASTis specified, null values sort after all non-null values; ifNULLS FIRSTis specified, null values sort before all non-null values. If neither is specified, the default behavior isNULLS LASTwhenASCis specified or implied, andNULLS FIRSTwhenDESCis specified (thus, the default is to act as though nulls are larger than non-nulls).
--
Born in Arizona, moved to Babylonia.
Born in Arizona, moved to Babylonia.
В списке pgsql-general по дате отправления: