Re: New Window Function: ROW_NUMBER_DESC() OVER() ?
| От | Michał Kłeczek | 
|---|---|
| Тема | Re: New Window Function: ROW_NUMBER_DESC() OVER() ? | 
| Дата | |
| Msg-id | 081D9B3E-A106-49E0-AA0E-EE9A09E3B7CC@kleczek.org обсуждение исходный текст | 
| Ответ на | RE: New Window Function: ROW_NUMBER_DESC() OVER() ? (Maiquel Grassi <grassi@hotmail.com.br>) | 
| Ответы | RE: New Window Function: ROW_NUMBER_DESC() OVER() ? RE: New Window Function: ROW_NUMBER_DESC() OVER() ? Re: New Window Function: ROW_NUMBER_DESC() OVER() ? | 
| Список | pgsql-hackers | 
On 16 Jan 2024, at 16:51, Maiquel Grassi <grassi@hotmail.com.br> wrote:Imagine I have a dataset that is returned to my front-end, and I want to reverse enumerate them (exactly the concept of Math enumerating integers). The row_number does the ascending enumeration, but I need the descending enumeration.
You can do:
-(ROW_NUMBER() OVER ()) AS descending
(note “-“ in front)
I don't have a base column to use for "order by,"
I think that’s the main issue: what (semantically) does row_number() mean in that case? You could equally well generate random numbers?
— 
Michal
В списке pgsql-hackers по дате отправления: