• ronmoses (12/6/2011)


    Would this not work as well?

    Yup! (As you already found out after posting).

    The only thing I don't like about your query is the semicolon before WITH. Semicolons belong at the end of each statement, not at the start.


    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/