New Window Function: ROW_NUMBER_DESC() OVER() ?

Поиск
Список
Период
Сортировка
От David G. Johnston
Тема New Window Function: ROW_NUMBER_DESC() OVER() ?
Дата
Msg-id CAKFQuwamiTRZK7KToG4cC9DdaFw2gVGZ+tGLyLPCU7VjgE++PA@mail.gmail.com
обсуждение исходный текст
Ответ на RE: New Window Function: ROW_NUMBER_DESC() OVER() ?  (Maiquel Grassi <grassi@hotmail.com.br>)
Ответы RE: New Window Function: ROW_NUMBER_DESC() OVER() ?
Список pgsql-hackers
On Tuesday, January 16, 2024, Maiquel Grassi <grassi@hotmail.com.br> wrote:

However, initially, I have one more obstacle in your feedback. If I use count(*) over() - row_number() over(), it gives me an offset of one unit. To resolve this, I need to add 1. 

This way, simulating a reverse row_number() becomes even more laborious.

I don’t really understand why you think this reverse inserted counting is even a good idea so I don’t really care how laborious it is to implement with existing off-the-shelf tools.  A window function named “descending” is non-standard and seemingly non-sensical and should not be added.  You can specify order by in the over clause and that is what you should be doing.  Mortgage payments are usually monthly, so order by date.

David J.

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

Предыдущее
От: Michał Kłeczek
Дата:
Сообщение: Re: New Window Function: ROW_NUMBER_DESC() OVER() ?
Следующее
От: Konstantin Knizhnik
Дата:
Сообщение: Re: index prefetching