HANA Query group by but add values
I am trying to write a query in HANA that achieves the following:
So I want to make the Sales_ID unique. At the same time I want to add the Revenue of each Sales_ID.
What I did so far: Selecting Sales_ID and Revenue, group by Sales_ID and sum up the revenue. So far so good. But it doesnt work when I add the field "Product_ID" since there are different values in each row. (so it doesnt group anymore) But I'm good if I just have the Product_ID of the first row of each Sale.
How do I do that?
You could try min(Product_ID).
Besides that, I'd suggest not to discuss the meaning of the term 'first row' in a relational database ...