I had an exam ... in SQL.
One question I didn't know is- I have a "Sales" Table and I want to SUM all sales by Product_Key.
I want to SELECT Product_Key, SUM(Sales) from different invoices.
In addition I need to have in the last row of the table, the SUM() of all the "Other" items, all the items for whom the total sales were 1000 or less.
How can I do it?
I wrote this query, but this won't give me the last row of: "Others":
SELECT [Product_Key], SUM([sales])
GROUP BY [Product_Key]
HAVING SUM([sales]) > 1000
Thank you in advance for answering and helping me progress