> On 16 Jan 2024, at 16:51, Maiquel Grassi <gra...@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

Reply via email to