Query:


SELECT p.prod_no, SUM(s.Qty_Order) "Sold Qty", 
SUM(p.unit_price * s.qty_order) as "Total value"
FROM sales_order_t5 s
JOIN product p
ON p.prod_no = s.product_no
GROUP BY p.prod_no;
Output:
PROD_N   Sold Qty Total value
------ ---------- -----------
0001            4          12
0002            2           0
0004           10          20
0003            2           6

Leave a Reply

Subscribe to Posts | Subscribe to Comments

All Notes on BCA

All Notes  on BCA
BCA all subjects notes

Total Pageviews

Translate

Powered by Blogger.

Copyright © All Notes on BCA