The following steps show the processing order for a SELECT statement.
-
FROM
-
ON
-
JOIN
-
WHERE
-
GROUP BY
-
WITH CUBE or WITH ROLLUP
-
HAVING
-
SELECT
-
DISTINCT
-
ORDER BY
-
TOP
This is the reason where we can not use column alias on Where clause, however we can use it on Select / Order by.
If interested on the logical order of the query processing poster, download it from here.
Reference: http://msdn.microsoft.com/en-us/library/ms189499.aspx
No comments:
Post a Comment