SQL Server – TSQL DISTINCT or GROUP BY?

by Jon Hibbins on 3 September 2008
Filed under: Code, Database, MSSQL2005, MSSQL2008, SQL Server, Software Development, TSQL

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 Response to “SQL Server – TSQL DISTINCT or GROUP BY?”

  1. Pages tagged "distinct" Says:

    [...] bookmarks tagged distinct SQL Server – TSQL DISTINCT or GROUP BY? saved by 3 others     LilGoth2292 bookmarked on 09/03/08 | [...]

Leave a Reply