Multiple SELECT statements Using One WITH statement

From: Avi Weinberg <AviW(at)gilat(dot)com>
To: "pgsql-general(at)lists(dot)postgresql(dot)org" <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Multiple SELECT statements Using One WITH statement
Date: 2022-01-20 12:48:39
Message-ID: DB9PR07MB7180D7EB60AC27E3409E1572CB5A9@DB9PR07MB7180.eurprd07.prod.outlook.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi,

Can I have multiple select statements using one WITH statement?

WITH t AS (
Select A, B from ...
)
SELECT A into tableA FROM t where ....;

SELECT B into tableB FROM t where ....;

IMPORTANT - This email and any attachments is intended for the above named addressee(s), and may contain information which is confidential or privileged. If you are not the intended recipient, please inform the sender immediately and delete this email: you should not copy or use this e-mail for any purpose nor disclose its contents to any person.

Responses

Browse pgsql-general by date

  From Date Subject
Next Message David G. Johnston 2022-01-20 12:58:24 Re: Multiple SELECT statements Using One WITH statement
Previous Message o1bigtenor 2022-01-20 12:24:21 Re: Can we get the CTID value