Query:


SELECT DISTINCT description, no_of_items_purchased as Total_Sold
FROM product_t5 p, cust_prod_t5 cp
WHERE EXISTS (SELECT * FROM Cust_prod_t5 WHERE cp.prod_no = p.pr
od_no);

Output:
DESCRIPTION          TOTAL_SOLD
-------------------- ----------
zzz                          60
xxx                          50
yyy                          50
xxx                          30
aaa                          10

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