All nonaggregated columns in the SELECT clause must also be listed in the GROUP BY clause
If we're nitpicking :rolleyes: then....
Even though I got it correct I don't think it is completely correct.
"extra" = 'X' is an expression not a column in the query and therefore is not bound by the above rule. :laugh:
I saw solutions that used Group By without aggregates
Yep
SELECT col1 FROM
GROUP BY col1
yields the same result as
SELECT DISTINCT col1 FROM
However GROUP BY includes an implicit COUNT(*) if not explicitly defined and therefore technically all GROUP BY's have an aggregate 😉
Far away is close at hand in the images of elsewhere.
Anon.