Skip to main content
The 2026 Annual Developer Survey is live— take the Survey today!

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

8
  • 2
    Why are you grouping by the InvoiceNo as well? Commented Jul 26, 2022 at 8:59
  • 3
    And why are you grouping by customerregion if you restrict you result to one single customerregion Commented Jul 26, 2022 at 9:00
  • Just GROUP BY Customerregion should do it. Commented Jul 26, 2022 at 9:01
  • Thank you derpirscher, you are right - that can be removed. There will be multiples area and I added the clause to try and get to a result. Commented Jul 26, 2022 at 9:02
  • 1
    Please don't show your sample data as image, but as text. If it was text then we could copy/paste it to create a temporary table and try out your query, correct it and then provide you with an answer. But since it is in an image, we would have to type over all your sample data, that is not our job but yours. Thank you Commented Jul 26, 2022 at 9:22

lang-sql