Here are a few links to some of the other CTE examples used during my Common Table Expressions presentation.
- Using a CTE in a Function to Split Up a Query String
- Using a CTE to Split a String Into Rows
- Can we use CTEs use in SSRS?
- CTE Hierarchy compared to the alternative
- Calculating Factorials with a Recursive CTE
- CTE – With An Insert Statement
- Fibonacci Sequence
- Generating a Tree Path with a CTE
- CTE Query Performance
- Multiple CTE’s in a single Query
- Recursive CTE’s
- Common Table Expressions Page
- A Fun Thanksgiving Day Query.
- Common Table Expressions
Just a quick summary of the samples.
You can also find more CTE examples on the TSQL Wiki.