Timeline for SQL Server Group By and Count
Current License: CC BY-SA 4.0
Post Revisions
14 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| May 11, 2024 at 8:12 | history | edited | Dale K | CC BY-SA 4.0 |
deleted 39 characters in body
|
| Jul 26, 2022 at 9:40 | vote | accept | Mr Jackson | ||
| Jul 26, 2022 at 9:38 | history | edited | Mr Jackson | CC BY-SA 4.0 |
added 247 characters in body
|
| Jul 26, 2022 at 9:35 | answer | added | Andrew | timeline score: 1 | |
| Jul 26, 2022 at 9:25 | comment | added | Mr Jackson | Thank you @GuidoG - I wasn't expecting you to create a temp table - will do in the future! | |
| Jul 26, 2022 at 9:22 | comment | added | GuidoG | 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 | |
| Jul 26, 2022 at 9:05 | comment | added | Thom A♦ |
If you want it by InvoiceNo why are you not returning InvoiceNo in the SELECT?
|
|
| Jul 26, 2022 at 9:05 | comment | added | Mr Jackson | Yes, Group By Customerregion gives me a full count, but want to try and break it down by unqieue invoiceno. I wias thinking to group by the unique invno | |
| Jul 26, 2022 at 9:02 | comment | added | Mr Jackson | 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. | |
| Jul 26, 2022 at 9:01 | comment | added | Nathan_Sav |
Just GROUP BY Customerregion should do it.
|
|
| Jul 26, 2022 at 9:00 | comment | added | derpirscher |
And why are you grouping by customerregion if you restrict you result to one single customerregion
|
|
| Jul 26, 2022 at 8:59 | history | edited | Mr Jackson | CC BY-SA 4.0 |
added 1 character in body
|
| Jul 26, 2022 at 8:59 | comment | added | Thom A♦ |
Why are you grouping by the InvoiceNo as well?
|
|
| Jul 26, 2022 at 8:58 | history | asked | Mr Jackson | CC BY-SA 4.0 |