• Carlo Romagnano (10/14/2008)


    Also the DISTINCT clause and the GROUP BY perform an implicit ORDER BY for all cols, but "IMPLICIT" is not the rule nor is written in the BOL.

    I'm fully aware of that. I was trying to explain why, in this case, on the current versions of SQL, the null always comes first.

    Oh, and if you look at the exec plan for this query, SQL's actually not doing a sort at all.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass