Actually it isn&#x27;t specific to GROUP BY, the problem comes from the fact that some DMBS (MySQL for example) which ignore leading and trailing whitespaces (and other stuff like capitalization) while comparing strings, leading them to count less unique strings that a stricter comparision would count.