Suppose that I have a query Q1 and I need to run a query like the following:

Q1
union
select *
from (some query that uses Q1 outcome)

I would like to do that:

  • Without creating any view
  • Without running twice the Q1 query.

How can I do that on PostgreSQL?

没有正确的解决方案

许可以下: CC-BY-SA归因
不隶属于 dba.stackexchange
scroll top