SV: Onfly, function generated ID for Select Query

2023-03-09 Thread Gustavsson Mikael
Kopia: Postgres General Ämne: Re: Onfly, function generated ID for Select Query Dear Mikael! Wow... 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? SELECT

Re: Onfly, function generated ID for Select Query

2023-03-09 Thread Durumdara
ant? > https://www.postgresql.org/docs/current/functions-window.html > > KR > Mikael > -- > *Från:* Durumdara > *Skickat:* den 10 mars 2023 8:12 > *Till:* Postgres General > *Ämne:* Onfly, function generated ID for Select Query > > Dear Members!

SV: Onfly, function generated ID for Select Query

2023-03-09 Thread Gustavsson Mikael
Hi, Is it something like row_number() you want? https://www.postgresql.org/docs/current/functions-window.html KR Mikael Från: Durumdara Skickat: den 10 mars 2023 8:12 Till: Postgres General Ämne: Onfly, function generated ID for Select Query Dear Members

Onfly, function generated ID for Select Query

2023-03-09 Thread Durumdara
Dear Members! I'm searching for a simple solution, like this: select GetIDForThisSelect(1, 1) as UID, * from anytablehasdoublestringkey join othertablehasnotuniqueintegerkey ... where Ok, I can make a sequence, but I don't want to use persistent data. It is enough to get 1...N as UID for th