Logical Processing Order of SELECT
The steps above show the logical processing order, or binding order, for a SELECT statement. This order determines when the objects defined in one step are made available to the clauses in subsequent steps. CTEs
Below, is a list of those statements and/or clauses that cannot be used in ANY CTE. COMPUTE or COMPUTE BY ORDER BY (except when a TOP clause is specified) INTO OPTION clause with query hints FOR XML FOR BROWSE Recusrsive CTEs
Here are the statements and/or clauses that cannot be used in a recursive CTE: SELECT DISTINCT GROUP BY HAVING Scalar aggregation (meaning you can't use min or max) TOP LEFT, RIGHT, OUTER JOIN (INNER JOIN is allowed) OVER and PARTITION BY
|
XML Trick: List of Details
EXCEPT/INTERSECT
MERGE
|
Cheatography
https://cheatography.com
Forgotten T-SQL Cheat Sheet Cheat Sheet by renegrin
Inspired by MidnightDBA here's a reference sheet includes the Logical Processing Order of SELECT, shorthand for recursive CTEs and MERGE, the famous list-of-details XML trick, and more.
Created By
tigersi.com
Metadata
Favourited By
Comments
No comments yet. Add yours below!
Add a Comment
More Cheat Sheets by renegrin