I am trying to merge 2 tables into 1 column. Is there anyway I can do it?
For example, I have Table 1 and Table 2 which looks like
Table1:
unit Item
1 apple
2 ball
3 cat
4 dog
5 elephant
Table2:
unit Field1
1 test1
1 test2
2 apple1
2 test1
3 ball1
3 cat1
4 dot1
4 elp
5 rat
5 rat1
5 rat2
If I use:
Select * from table1 as a left join table2 as b on a.unit = b.unit,
I will get multiple rows as there are multiple units in table 2.
What I want is
Unit item field1_1 field1_2 field1_3
1 apple test1 test2 null
2 ball apple1 test1 nul
3 cat ...................
4 dog..............
5 elephant rat rat1 rat2
Is there anyway I can get the result?
Thank you