Using Common Table Expressions in SQL Server
In this post I would like to talk about Common Table Expressions or CTE . I know there are samples of how to use CTE in BOL,MSDN and elsewhere but I thought that it would be a good idea to give it a try with hands-on examples.CTEs were introduced in SQL Server 2005. You can think of them as temporary views.They last only for the duration of the execution of the query.(
read more)