例子:
代码如下:
with q1 as (select 0+1 num1 from dual),q2 as (select 1+1 num2 from dual),q3 as (select 2+1 num3 from dual)
select * from q1
union
select * from q3
union
select * from q2;
select * from q1
union
select * from q3
union
select * from q2;
定义了q1,q2,q3,后面就一定要引用,不一定在主查询中。 原文链接:https://www.f2er.com/oracle/65528.html