Requirements: I want to show the stock for particular B_Name, if date are same it will show on same row, if date are not same it will show on different row and also '-' will be specify
Two tables namely gr and frosted
table gr:
B_Name B_Date B_Qty
A 2015-08-11 15000
A 2015-08-15 25000
A 2015-08-31 20000
table frosted:
M_Name M_Date M_Qty
A 2015-08-11 15000
A 2015-08-25 25000
B 2015-08-20 20000
A 2015-08-15 15000
Following output:
for Particular B_Name like here (A)
Date Inward(B_Qty) Outward(M_Qty)
2015-08-11 15000 15000
2015-08-15 25000 15000
2015-08-31 20000 -
2015-08-25 - 25000
I tried join and union but it is not working as per my requirements.
LEFT JOINbecause some items from your table frosted may not be existing for the same date as items of the table gr.