I have two tables. (Below given are example tables. originally I have 6 tables)
Table cpp;
----------------------
| name    |  spent1  |
----------------------
|john     |   32     |
|Johny    |   2      |
----------------------
Table java
----------------------
| name    |  spent2  |
----------------------
|mary     |   42     |
|Johny    |   2      |
----------------------
Output what I want is like
---------------------------------
| name    |  spent1  |  spent2  |
---------------------------------
|john     |   32     |  null    |
|Johny    |   2      |  2       |
|mary     |   null   |  42      |
---------------------------------
I tried many things and couldn't get the answer. Can someone suggest me a join in mysql to get the desired output.
 
    