Keeping it simple and how to do multiple CTE in a query
You can have multiple CTEs in one query, as well as reuse a CTE: Note, however, that SQL Server may reevaluate the CTE each time it is accessed, so if you are using values like RAND(), NEWID() etc., they may change between the CTE calls.