一张表中含有F1、F2、F3、F4四列
我希望能将F1、F2列中的数据和F3、F4列中的数据合并组成一个新表
F1   F2    F3   F4
1     2     3    4组合后的表test1    test2
  1        2
  3        4

解决方案 »

  1.   

    slect * into newtable
    from 
    (select f1,f2 from tb union all
    select f3,f4 from tb) t
      

  2.   

    select f1,f2 from tb 
    union all
    select f3,f4 from tb
      

  3.   


    select f1 , f2 from tb
    union all
    select f3 , f4 from tb
      

  4.   

    --1,不用建表
    select * into newtable
    from 
    (select f1,f2 from tb union all
    select f3,f4 from tb) t
    --2,要建表
    insert newtable(test1,test2)
    select f1,f2 from tb 
    union all
    select f3,f4 from tb
      

  5.   


    insert into table(test1,test2)
    select F1,F2
    from table
    union all
    select F3,F4
    from table