This is how query execution works. In your second expression, it does not perform any additional function, because yours , containing the same column name , has already performed this operation for you, DISTINCT GROUP BYContactTitle
1. FROM
2. WHERE
3. GROUP BY <-- You have specified the column `ContactTitle`,
-- which means the results would be grouped by that column to product unique
--result.
4. HAVING
5. SELECT <-- Adding DISTINCT on ContactTitle column here doesn't make much
-- difference and it is actually redundant. DISTINCT is applied to the whole
-- row but the resultset already contains distinct rows grouped by the column
-- `ContactTitle`.
6. ORDER BY
user756519
source
share