Thanks for the post, Helen. I do like CTE's and use them often but it's important to note that when CTE results in a large dataset the query performance dies pretty quickly. If the CTE result set goes over 10k rows I'd replace it with a local temp table. Otherwise, definitely better than nested queries.
We're a place where coders share, stay up-to-date and grow their careers.
We strive for transparency and don't collect excess data.