SQL Server – TSQL DISTINCT or GROUP BY?

DISTINCT v GROUP BY

A DISTINCT and GROUP BY usually generate the same query plan, so performance should be very simular or the same, if you only need to remove the dulicates then DISTINCT is easier to understand in the query, if you have a more complex query it may be worth running both and studdying the execution plan to see if your specific example wins

One Comment

Leave a Reply