Hi every one,
I have 3 table
table temp:
Name | Description
A | Description A
B | Description B
C | Description C
table temp1:
Name | order
A | 5
A | 4
B | 2
C | 3
table temp2:
Name | Payment
A | 3
B | 2
B | 3
Now, I am using this code:
Select temp.Name as Name, order, payment
from temp left join temp1 on temp.Name=temp1.Name
left join temp2 on temp.Name = temp2.Name
where temp1.Name is not Null and temp2.Name is not Null
And Result:
Temp | Order | Payment
A | 5 | 3
A | 4 | 3
B | 2 | 2
B | 2 | 3
C | 3 |
Now, I want to display like this
Temp | Order | Payment
A | 5 | 3
A | 4 | 0
B | 2 | 2
B | 0 | 3
C | 3 | 0
Any help me?