I Have two table:
Table 1 name: Buy
Name | Name code | Number |
a 01 25
a 01 25
b 02 75
c 03 100
c 03 25
And table 2 name: Sell
Name | Name code | Number |
b 02 60
b 02 40
c 03 80
c 03 40
d 04 45
d 04 50
So, how to make two tables join like this (Using MYSQL Query):
Name | Name code | Number | Name | Name code | Number |
a 01 50 (SUM) NULL NULL NULL
b 02 75 b 02 100(SUM)
c 03 125(SUM) c 03 120(SUM)
NULL NULL NULL
d 04 90(SUM)
When i type (SUM), it mean that value is SUM with 2 rows
Because this is so hard for me, so i need help so much
Please help me, i don't know how to do that. Thanks so much
And also if i need condition like b < 70 or C < 30 etc...