11
Reply

What is the order of a SQL Query execution?

Santosh Kumar Adidawarpu

Santosh Kumar Adidawarpu

Feb 11, 2017
3.1k
1

    the order of a SQL Query execution1. FROM 2. ON 3. OUTER 4. WHERE 5. GROUP BY 6. CUBE or ROLLUP 7. HAVING 8. SELECT 9. DISTINCT 10. ORDER BY 11. TOP

    Vinod Kakade
    May 12, 2017
    2

    1) from 2) on 3) Join 4) where 5) Group by 6) Having 7) select 8) Distinct 9) Order by 10) Top

    vinod kumar
    April 05, 2017
    1

    1.FROM 2.ON 3.JOIN 4.WHERE 5.GROUP BY 6.WITH CUBE or WITH ROLLUP 7.HAVING 8.SELECT 9.DISTINCT 10.ORDER BY 1.TOP

    Suresh Kumar
    November 08, 2017
    0

    1.FROM 2.ON 3.JOIN 4.WHERE 5.GROUP BY 6.WITH CUBE or WITH ROLLUP 7.HAVING 8.SELECT 9.DISTINCT 10.ORDER BY 1.TOP

    Suresh Kumar
    November 08, 2017
    0

    1.FROM 2.ON 3.JOIN 4.WHERE 5.GROUP BY 6.WITH CUBE or WITH ROLLUP 7.HAVING 8.SELECT 9.DISTINCT 10.ORDER BY 1.TOP

    Suresh Kumar
    November 08, 2017
    0

    "SQL has no order of execution. Is a declarative language. The optimizer is free to choose any order it feels appropriate to produce the best execution time. Given any SQL query, is basically impossible to anybody to pretend it knows the execution order.

    Jothish Kumar
    September 14, 2017
    0

    The order of a SQL Query execution as per below : 1. FROM 2. ON 3. OUTER 4. WHERE 5. GROUP BY 6. CUBE or ROLLUP 7. HAVING 8. SELECT 9. DISTINCT 10. ORDER BY 11. TOP

    Upendra Pratap Shahi
    September 12, 2017
    0

    Hi ,Order clause is used to sort the data in descending order and ascending order . Here is syntax: SELECT column-list FROM table_name [WHERE condition] [ORDER BY column1, column2, .. columnN] [ASC | DESC];

    Gajendra Singh
    September 05, 2017
    0

    FROMONJOINWHEREGROUP BYWITH CUBE or WITH ROLLUPHAVINGSELECTDISTINCTORDER BYTOP

    Raj Kumar
    June 06, 2017
    0

    FROM ON JOIN WHERE GROUP BY WITH CUBE or WITH ROLLUP HAVING SELECT DISTINCT ORDER BY TOP

    Rakesh Singh
    March 28, 2017
    0

    We use SELECT statement to retrieve data from SQL. Generally we type T-SQL clauses in below order: SELECT FROM WHERE GROUP BY HAVING ORDER BY But the logical query processing order is different. FROM WHERE GROUP BY HAVING SELECT ORDER BY For example - If we want return all employees from deptno 30. SELECT ename,sal FROM emp WHERE deptno=30 ORDER BY ename When it goes to SQL, it executes as below FROM emp WHERE deptno=30 SELECT ename,sal ORDER BY ename Each execution phase operates on one or more tables (if JOIN involved) as inputs and returns a virtual table as output. The output table of one phase is considered the input to the next phase.

    Santosh Kumar Adidawarpu
    February 11, 2017
    0