• Typically I've found that DISTINCT is faster than GROUP BY when SELECTing a single column, i.e. as below, but obviously that could vary:

    SELECT DISTINCT

    SSF.customerId

    FROM #example SSF

    WHERE SSF.sales IS NOT NULL

    --vs.

    SELECT

    SSF.customerId

    FROM #example SSF

    WHERE SSF.sales IS NOT NULL

    GROUP BY SSF.customerId

    SQL DBA,SQL Server MVP(07, 08, 09) A socialist is someone who will give you the shirt off *someone else's* back.