public inbox for [email protected]
help / color / mirror / Atom feedCan we generate a series of tables in a loop and then use another loop to union all?
2+ messages / 2 participants
[nested] [flat]
* Can we generate a series of tables in a loop and then use another loop to union all?
@ 2022-10-13 15:44 Shaozhong SHI <[email protected]>
2022-10-13 16:50 ` Re: Can we generate a series of tables in a loop and then use another loop to union all? Frank Gard <[email protected]>
0 siblings, 1 reply; 2+ messages in thread
From: Shaozhong SHI @ 2022-10-13 15:44 UTC (permalink / raw)
To: pgsql-sql <[email protected]>
Can we do the following?
for j in 1..max loop
create table j as select .............
end loop;
Then, We do
Alternatively, can we generate an empty table and append each newly
generated table to it so that we end up with a whole table?
Regards,
David
^ permalink raw reply [nested|flat] 2+ messages in thread
* Re: Can we generate a series of tables in a loop and then use another loop to union all?
2022-10-13 15:44 Can we generate a series of tables in a loop and then use another loop to union all? Shaozhong SHI <[email protected]>
@ 2022-10-13 16:50 ` Frank Gard <[email protected]>
0 siblings, 0 replies; 2+ messages in thread
From: Frank Gard @ 2022-10-13 16:50 UTC (permalink / raw)
To: [email protected]
Hi,
you can use PL/pgSQL's "EXECUTE" to do such things.
Cheers,
Frank.
Am 13.10.22 um 17:44 schrieb Shaozhong SHI:
> Can we do the following?
>
> for j in 1..max loop
> create table j as select .............
> end loop;
>
> Then, We do
>
>
> Alternatively, can we generate an empty table and append each newly generated table to it so that we end up with a whole table?
>
> Regards,
>
> David
^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2022-10-13 16:50 UTC | newest]
Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2022-10-13 15:44 Can we generate a series of tables in a loop and then use another loop to union all? Shaozhong SHI <[email protected]>
2022-10-13 16:50 ` Frank Gard <[email protected]>
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox