The SQL standard knows an interesting feature where you can project any functional dependencies of a primary (or unique) key that is listed in the
GROUP BY
clause without having to add that functional dependency to theGROUP BY
clause explicitly.
I was unaware that this functionality existed (in some database platforms), and I’m not positive that I like it.