I have 2 Tables named Product, Stock as follows Product Table:-
Id Name Hand
1 A 50
2 B 5
3 C 10
Stock Table:-
Id Pid Qty
1 1 50
I want total stock of every product so hand column showing the opening stock. I tried:
select product.id, name, hand, count(qty)
from product
left join stock on pid=product.id
but it's giving me only the first product detail even i am doing left join