Eirikur Eiriksson (4/8/2014)
hisakimatama (4/8/2014)
Aha, so it doesn't :-). I've always declared CTEs with the column declarations, and by the wonderful problems of habit, it stuck as "the" way to do it. Well, I learned something that should make syntax a good bit clearer myself 😀I prefer it, makes the code more readable.
😎
I've found just the opposite to be true if there are a ton of columns being returned by the CTE. I'd just as soon write it as a good and proper encapsulated SELECT and let the defintion of the CTE be simple.
But, to each their own! I even change my ways when I'm working for a different company and they say how they want it done. 😛
--Jeff Moden
Change is inevitable... Change for the better is not.