When to use Common Table Expression (CTE)
One example, if you need to reference/join the same data set multiple times you can do so by defining a CTE. Therefore, it can be a form of code re-use. An example of self referencing is recursion: Recursive Queries Using CTE For exciting Microsoft definitions Taken from Books Online: A CTE can be used to: … Read more