Have you ever used the Common Table Expression in SQL query scripts? It is very useful feature. CTE make the scripts easier to read and maintain. And it is also easier to write sql scripts with CTE for complex queries. CTEs can reference themselves.
With CTE_Table as
(
select column1, column2, column3 ... from table1 join table2 on column1 = column3
)
select *, table3.column1 from CTE_Table join Table3 on .........................
The script is very clean and simple
Thursday, January 21, 2010
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment