P74 (8/5/2014)
Wow! thanks for the help Lynn, Jeff.just going through the code now... what is the use of (n) after the cte name or after a table name?
e1(n) << the n here is the column name. Read about CTEs is Books Online.
#TestData td << td is a table alias for the table #TestData. Again, read about this in Books Online as well.