Skip to main content

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.

Required fields*

3
  • I missed that OP wanted to return a list of the sku; I viewed that part as comments next to the result set, illustrating how each "count" value was derived. Other answers sufficiently demonstrate the use of the GROUP_CONCAT aggregate function. Commented Jun 24, 2014 at 19:06
  • this works perfectly, thank you. Actually I showed the breakdown for illustration to help explain my question. In reality the Group Concat would not be practical since the duplicates run into the thousands. Commented Jun 24, 2014 at 19:07
  • @sdfor: given that you didn't know how to return this resultset, I thought it would be helpful to give some commentary about how this works, rather than just posting a SQL statement, so that you (and future readers) will be able to apply the same pattern to a similar problem in the future. (And you will run into a limitation of the GROUP_CONCAT function.) Commented Jun 24, 2014 at 19:09