Don't just throw more columns into the group

I’ve apparently missed an important point about SQL joins. You know when you are trying to run a SQL query with “group by” and it nags you about needing to have each selected column in the group by…so you just stuff them all in. (Yes, you, grandma.) Anyway, that’s not the way to do it. This guy shows how to do it the right way.

One thought on “Don't just throw more columns into the group”

  1. This is a huge problem for Coldfusion Developers, we have a Group By in our CFquery that actually flattens the results however you want. They get into sql and try to do the same. Takes time to figure out that SQL Group by is an aggregate function.

Leave a Reply

Your email address will not be published. Required fields are marked *