'I am looking for sum of the sales made since June-1997 on a yearly basis according to the category_name

but i have some problem in sum Is there any other solution?

select EXTRACT( YEAR FROM shipped_date) As shippedyear,
       category_name,
       sum(unit_price*quantity*(1-discount))::Numeric(16,2) as categorysales    
FROM data1.order_details 
natural join data2.orders 
natural join data3.categories
where shipped_date >='1997-07-01'
GROUP BY shipped_date,category_name,unit_price,quantity,discount
order by categorysales desc


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source