SV: Onfly, function generated ID for Select Query - Mailing list pgsql-general

From Gustavsson Mikael
Subject SV: Onfly, function generated ID for Select Query
Date
Msg-id 7e3ca307301b4928a23c3c0a8cc2b576@smhi.se
Whole thread Raw
In response to Onfly, function generated ID for Select Query  (Durumdara <durumdara@gmail.com>)
Responses Re: Onfly, function generated ID for Select Query
List pgsql-general

Hi,


Is it something like row_number() you want?https://www.postgresql.org/docs/current/functions-window.html

KR

Mikael

Från: Durumdara <durumdara@gmail.com>
Skickat: den 10 mars 2023 8:12
Till: Postgres General
Ämne: Onfly, function generated ID for Select Query
 
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 this select.

Like generate_series, but that is generating rows.

Maybe you have some trick to do this.

Thank you for any assistance!

Best regards
dd

pgsql-general by date:

Previous
From: Durumdara
Date:
Subject: Onfly, function generated ID for Select Query
Next
From: Durumdara
Date:
Subject: Get more columns from a lookup type subselect