sugarferret
IS-IT--Management
hi, i have duplicated values in the first column like this:
SKU,REVENUE
----------
a002,20
a002,35
b017,1
b017,14
This is the SQL code which generates that table:
SKU,REVENUE
----------
a002,20
a002,35
b017,1
b017,14
This is the SQL code which generates that table:
Code:
SELECT SKU, REVENUE = sum(ShippedSubtotal)
FROM OrderDetails
WHERE ShippedSubtotal > 0;[code]
My question is little bit challenging (for me)...
How can i edit the sql code in order to display the SKU values with no duplicated and the sum of Revenue for those duplicated SKU, see this table, this is what i need:
SKU,REVENUE
----------
-->No duplicated sku's a002,55 <--and with the sum of revenue
b017,15
does it made sense... can help me please?
any help or advicing will be appreciated.
thanks in advance.
Aldo