sql - Total Quantity for each product query -


i have table product following attributes:

productcode(pk) proddescription price stocklevel 

another table prodline following attributes:

ordernumber(fk) prodcode(fk) quantity 

now each product want list out product_code, stock_level , total quantity ordered. how can performed?

select a.productcode, a.stocklevel, sum(a.quantity) product  inner join prodline b on a.productcode=b.prodcode group a.productcode 

Comments

Popular posts from this blog

shopping cart - Page redirect not working PHP -

php - How to modify a menu to show sub-menus -

python - Installing PyDev in eclipse is failed -