| From: | Gustavsson Mikael <mikael(dot)gustavsson(at)smhi(dot)se> |
|---|---|
| To: | Durumdara <durumdara(at)gmail(dot)com>, Postgres General <pgsql-general(at)postgresql(dot)org> |
| Subject: | SV: Onfly, function generated ID for Select Query |
| Date: | 2023-03-10 07:33:12 |
| Message-ID: | 7e3ca307301b4928a23c3c0a8cc2b576@smhi.se |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | 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(at)gmail(dot)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
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Durumdara | 2023-03-10 07:34:53 | Get more columns from a lookup type subselect |
| Previous Message | Durumdara | 2023-03-10 07:12:11 | Onfly, function generated ID for Select Query |