6
Reply

Considering SELECT statement, in which order the query clauses are logically processed?

Akshay Patel

Akshay Patel

13y
1.8k
0
Reply
    The clauses are logically processed in following order:
    1. FROM
    2. WHERE
    3. GROUP BY
    4. HAVING
    5. SELECT
    6. ORDER BY
    From On Outer where group by rollup cube Having select Distinct order by top
    From On Outer where group by rollup cube Having select Distinct order by top
    From On Outer where group by rollup cube Having select Distinct order by top
    In select Statement Order of Clauses is From Where Select
    Here i am adding some more MS SQL Server objects logical execution order.1. FROM 2. ON 3. OUTER 4. WHERE 5. GROUP BY 6. CUBE | ROLLUP 7. HAVING 8. SELECT 9. DISTINCT 10 ORDER BY 11. TOPReference from blog.sqlauthority.com