No, the result will be ordered by the window functions order clause so no additional ordering is nessesary. You can try this by changing it to OVER(ORDER BY product_name)
KR
Mikael
Från: Durumdara <durumdara@gmail.com> Skickat: den 10 mars 2023 08:41:06 Till: Gustavsson Mikael Kopia: Postgres General Ämne: Re: Onfly, function generated ID for Select Query
Dear Mikael!
Wooooow... that is it!
Thank you!
SELECT product_id, product_name, group_id, ROW_NUMBER () OVER (ORDER BY product_id) FROM products;
Does this mean that I have to duplicate the order by clause?