Mar 25, 2013

Logical query processing order

The logical query processing order

(1)   FROM
(2)   WHERE
(3)   GROUP BY
(4)   HAVING
(5)   SELECT
(6)   ORDER BY

> "Each phase operates on one or more tables as inputs and returns a virtual table as output. The output table of one phase is considered the input of the next phase. This is in accord with operation on relations that yield a relation."

> "If you assign an alias to a table, you basically rename the table for the duration of the query. The original table name isn't visible anymore; only the alias is."
------------------
Reference: Querying Microsoft SQL Server 2012 Training Kit by Itzik Ben-Gan, Dejan Sarka, Ron Talmage

No comments:

Post a Comment