I have two tables like this,
Table1 :
+-------------+--------+--------+--------+
| contract_id | price1 | price2 | price3 |
+-------------+--------+--------+--------+
| 1 | 23 | 45 | 56 |
| 1 | 22 | 21 | 453 |
| 1 | 45 | 564 | 456 |
| 4 | 22 | 21 | 453 |
| 5 | 45 | 564 | 456 |
+-------------+--------+--------+--------+
and Table2,
+-------------+--------+---------+
| contract_id | owner | address |
+-------------+--------+---------+
| 1 | Me | Madras |
| 1 | father | Chennai |
+-------------+--------+---------+
I want to stitch both the tables together so the result appears like,
+-------------+--------+--------+--------+--------+---------+
| contract_id | price1 | price2 | price3 | owner | address |
+-------------+--------+--------+--------+--------+---------+
| 1 | 23 | 45 | 56 | Me | Madras |
| 1 | 22 | 21 | 453 | father | Chennai |
| 1 | 45 | 564 | 456 | NULL | NULL |
| 4 | 22 | 21 | 453 | NULL | NULL |
| 5 | 45 | 564 | 456 | NULL | NULL |
+-------------+--------+--------+--------+--------+---------+
Currently I'm manually iterating through the second table and updating the corresponding rows in first table to acheive this. Other approach I figured out is to do a outer join and clean up the duplicate rows. Is there a more better way to acheive the result?