Santosh Kumar Adidawarpu
What is the order of a SQL Query execution?
By Santosh Kumar Adidawarpu in .NET on Feb 11 2017
  • Vinod Kakade
    May, 2017 12

    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

    • 2
  • vinod kumar
    Apr, 2017 5

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

    • 1
  • Suresh Kumar
    Nov, 2017 8

    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

    • 0
  • Suresh Kumar
    Nov, 2017 8

    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

    • 0
  • Suresh Kumar
    Nov, 2017 8

    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

    • 0
  • Guest User
    Sep, 2017 14

    "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.

    • 0
  • Upendra Pratap Shahi
    Sep, 2017 12

    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

    • 0
  • Gajendra Singh
    Sep, 2017 5

    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];

    • 0
  • Raj Kumar
    Jun, 2017 6

    FROMONJOINWHEREGROUP BYWITH CUBE or WITH ROLLUPHAVINGSELECTDISTINCTORDER BYTOP

    • 0
  • Rakesh Singh
    Mar, 2017 28

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

    • 0
  • Santosh Kumar Adidawarpu
    Feb, 2017 11

    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.

    • 0


Most Popular Job Functions


MOST LIKED QUESTIONS