• dwain.c (1/7/2013)


    Any solution posed with a CTE can always be done without the CTE by making the CTE into a derived table as Lynn has shown.

    That's not entirely true. It's only true if the CTE is not recursive. Recursive CTEs cannot simply be rewritten as derived tables.

    Even where they can be rewritten as derived tables, I find the CTE syntax easier to understand, and would recommend using the CTE in any case.

    Drew

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA