用union allSQL> select * from test3; A B ---------- -------------------- 11 a 22 b 33 cSQL> create view test_v 2 as 3 select * from test3 4 where a=11 5 union all 6 select * from test3 7 where a=33;视图已创建。SQL> select * from test_v; A B ---------- -------------------- 11 a 33 c
select * from a where 条件1 union all select * from a where 条件2
---------- --------------------
11 a
22 b
33 cSQL> create view test_v
2 as
3 select * from test3
4 where a=11
5 union all
6 select * from test3
7 where a=33;视图已创建。SQL> select * from test_v; A B
---------- --------------------
11 a
33 c
from a
where 条件1
union all
select *
from a
where 条件2