sql server - Append tables in SQL -


if have 2 following tables,

table1

itemno  desc    order number    qty      s_date     location aa       aa         aaa              aa/aa/aaaa     aaaa bb       bb         bbb          b     bb/bb/bbbb     bbbb cc       cc         ccc          c     cc/cc/cccc     cccc 

table 2

m_order item    m_date      total xxx      x      xx/xx/xxxx   xx yyy      y      yy/yy/yyyy   yy 

can advice me how following table please.

result table

itemno  desc    order number    qty     s_date    location   m_date     total aa       aa        aaa              aa/aa/aaaa    aaaa         bb       bb        bbb           b    bb/bb/bbbb    bbbb         cc       cc        ccc           c    cc/cc/cccc    cccc         x       xxx                                                 xx/xx/xxxx    xx y       yyy                                                 yy/yy/yyyy    yy 

thanks

you can full outer join trick:

select t1.*, t2.* table1 t1 full outer join      table2 t2      on 1 = 0; 

this give columns in both tables. each row populated values 1 of tables.


Comments

Popular posts from this blog

c++ - QTextObjectInterface with Qml TextEdit (QQuickTextEdit) -

javascript - angular ng-required radio button not toggling required off in firefox 33, OK in chrome -

xcode - Swift Playground - Files are not readable -