在同一个表中以不同条件查询出数据然后放在一个视图中应该怎么做? 

解决方案 »

  1.   

    用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
      

  2.   

    select *
      from a
      where 条件1
    union all
    select *
      from a
      where 条件2