i have that product details table
contains different quantities for each product
(quantities i received in different dates)
i have that order details table
contains different quantities for same product
(quantities i sold in different dates)
now to find the amount left from each product
i need equation like this
(total quantity in stock) - (total quantity sold)
when i try to make it in a query
i couldn't do it without creating:
1-query to sum quantity in stock
2-query to sum quantity sold
3-query to find to subtract both quantities
when i try to make only one query to do all that
i get error message mostly about problem with aggregate function
any solution?
contains different quantities for each product
(quantities i received in different dates)
i have that order details table
contains different quantities for same product
(quantities i sold in different dates)
now to find the amount left from each product
i need equation like this
(total quantity in stock) - (total quantity sold)
when i try to make it in a query
i couldn't do it without creating:
1-query to sum quantity in stock
2-query to sum quantity sold
3-query to find to subtract both quantities
when i try to make only one query to do all that
i get error message mostly about problem with aggregate function
any solution?