Re: Multiple SELECT statements Using One WITH statement

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: Avi Weinberg <AviW(at)gilat(dot)com>
Cc: "pgsql-general(at)lists(dot)postgresql(dot)org" <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Re: Multiple SELECT statements Using One WITH statement
Date: 2022-01-20 12:58:24
Message-ID: CAKFQuwatCDPT0tNojn5fVQ7NOkUgcZb9n5=GRRLz-gHF+XDddA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Thursday, January 20, 2022, Avi Weinberg <AviW(at)gilat(dot)com> wrote:

> 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 ….;
>
>
> With q1 as (), q2 as (), q3 as () main_query

David J.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2022-01-20 14:05:23 Re: Cannot find hstore operator
Previous Message Avi Weinberg 2022-01-20 12:48:39 Multiple SELECT statements Using One WITH statement