fromFrom msdn :
Unlike a derived table, a CTE can be self-referencing and can be referenced multiple times in the same query.
ImI'm using CTECTEs quite a lot., but I've never thought deeply about :
my question2 : the benefits of using them.
When im doingIf I reference a CTE multiple referencing using CTe , times in the same query:
Is there any performance benefit ?Is there any performance benefit?
if im doing Self join , will it scan it twice ?If I'm doing a self join, will SQL Server scan the target tables twice?