Anyone out there know mySQL really well? I understand what order by does, and I understand what group by does. Can these two be used together? If so, how does it work? Does it group stuff together and then WITHIN the groups do the order_by? ie. If we had a database of people's info – and we did:
SELECT lastname, age FROM people GROUP BY lastname ORDER BY age DESC
would it list the the youngest to oldest people with the same last name – and then move onto the next group of lastnames, etc.? Would that be sorting the last names arbitrarily? If you wanted to sort the last names *reverse* alphabetically as well would you do this?:
SELECT lastname, age FROM people GROUP BY lastname ORDER BY lastname ASC, age DESC
Actually re-reading the GROUP BY descriptiong… maybe I DON'T understand GROUP BY… =sigh= anyone wanna help explain?