I have a table like given bellow, in Oracle:
[Products]
Product_ID | Product_NME | Product_SUP | Quantity
=================================================
1 Apple USA 100
2 Fish Japan 50
3 Wine Italy 10
4 Apple China 30
5 Fish Germany 10
I need a query that will find the full Quantity
for every Product_NME
by DISTINCT
.
The expected result should be:
- apple 130
- fish 60
- wine 10
I've tried to modify it like the one shown here as:
SELECT
distinct(Product_NME, Product_SUP), sum(Quantity)
FROM
Products
But it's not my case. Also I've tried this one:
SELECT DISTINCT Product_NME
FROM Products
UNION
SELECT SUM(Quantity) FROM Products
But is also not working.
Can anyone help me with this?
- Thanks