I have similar datasets to the following
TABLE1
Column1,Column2,Column3,
ID1 ,ID2 ,Value1
TABLE2
Column1,Column2,Column3,
ID3 ,ID2 ,Value2
I would like to get
TABLE3
Column1,Column2,Column3
ID1 ,ID2 ,Value1
ID3 ,ID2 ,Value2
I am currently using the following code
select * from table1
union all
select * from table2;
This is successfully adding the columns together, but I am getting some erroneous values. I am not sure what else I should be doing, any help is appreciated! I am using Vertica SQL.
EDIT ****** By erroneous values I mean for example: table2.value2 = (null) table3.value2 = 594792
Thanks