Nested CTE understanding with examples in SQL Server