I can use a CTE in a single query like this
with mycte as (...)
insert into table1 (col1) select col1 from mycte where col1 in
(select col1 from mycte)
But what if I want to use mycte in multiple queries? How can I make something like this work?
with mycte as (...)
insert into table1 (col1) select col1 from mycte where col1 in
(select col1 from mycte),
insert into table2 (col1) select col1 from mycte where col1 in
(select col1 from mycte)