表如下:
a     b
11    12
14    14
16    21查询后将a列和b列并成新表的一列
new
11
12
14
14
16
21
不要查询两次
select a as new from table
union all
select b from table不要这样的结构,只要查询一次的语句,谢谢。

解决方案 »

  1.   

    select nvl(t1.a,t2.b) 
    from table1 t1 full join table1 t2
    on 1=2
      

  2.   

    还不如用union select a as new from table
    union 
    select b as new from table
      

  3.   

    INSERT ALL 
      INTO NEW VALUES(a) 
      INTO NEW VALUES(b)
    SELECT a, b FROM OLD;
      

  4.   

    select t.a,t1.b
    from t t1 join in t
    on t.a=t1.a;