mysql - how to load two tables data into single table side by side -
i have 2 table , want 2 columns each table. , want keep these total 4 columns 1 table.
example:-
s1, s2, s3 columns of table1
s4, s5, s6 columns of table2
and want columns s1, s2, s4, s5 in table-3.
can 1 solve in hive.
if there column in table1 , table2 can used join use:
select t1.s1, t1.s2, t2.s4, t2.s5 table1 t1, table2 t2 t1.column_for_join = t2.column_for_join
and result table3 (s1,s2,s4,s5)
if there no column join, can use union this:
select s1,s2, null, null table1 union select null, null, s4,s5 table2
hope helps... pawel
Comments
Post a Comment