what is the order of execution of where,having,group by in
select stement

Answer Posted / bobby

The order of syntax for SELECT statement is

Select Top| Distinct
From Join
On
Where
Group By
Having
Oder By

But the order of execution of SELECT statement is
1.From
2.On
3.Join
4.Where
5.Group By
6.Having
7.Distinct
8.Select
9.Order By
10.Top

Is This Answer Correct ?    30 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How to create an index on a view?

745


What is repeatable read?

695


What is 5nf in normalization form?

729


Can binary strings be used in arithmetical operations?

680


What is the difference between char, varchar and nvarchar?

753






What is a dbms wizard?

767


What are the basic functions for master, msdb, model, tempdb and resource databases? : SQL Server Architecture

744


Is mysql better than sql server?

731


How you can get a list of all the table constraints in a database? : Sql server administration

686


You want to implement the one-to-many relationship while designing tables. How would you do it?

706


Why does a sql statement work correctly outside of a user-defined function, but incorrectly inside it?

654


What is the sql case statement used for?

755


What are the advantages dts has over bcp?

733


What is index in an assignment?

695


How to test subquery results with the exists operator?

745