• Toreador (5/28/2013)


    But don't quite understand the statement "The key to this is of course the use of DISTINCT".

    There is no use of DISTINCT, so how can it be the key to anything?

    First sentence of the explanation, emphasis mine:

    "EXCEPT returns any distinct values from the left query that are not also found on the right query"


    Hugo Kornelis, SQL Server/Data Platform MVP (2006-2016)
    Visit my SQL Server blog: https://sqlserverfast.com/blog/
    SQL Server Execution Plan Reference: https://sqlserverfast.com/epr/