dwain.c (5/9/2012)
...Personally, I love playing with recursive CTEs, almost as much as I like being naughty, just to figure out how they work. ๐
I always hear people saying "stay away from recursive CTEs because they're slow" ...
Play is an excellent way to learn - I love to play with the problems folks post on here (far too little time these days). Here's a few examples of rCTE's to whet your appetite:
Paul White's Super-fast DISTINCT
Have fun!
Cheers
ChrisM
For fast, accurate and documented assistance in answering your questions, please read this article.
Understanding and using APPLY, (I) and (II) Paul White
Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden