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

You want to check the syntax of a complicated update sql statement without executing it. What command should you use?

491


What is transaction server auto commit?

579


How to Check if table exists in sql server?

620


What are cursors? Explain different types of cursors. What are the disadvantages of cursors? How can you avoid cursors?

692


Do I need a report server to run reports in my application?

106






What is the default port for SQL Server over a firewall?

593


Write the syntax for stuff function in an sql server?

538


What do you understand by SQL*Net?

617


Explain the categories of stored procedure i.e. System stored procedure, local stored procedure, temporary stored procedure, extended stored procedure, remote stored procedure?

555


What is tablix?

115


How to apply filtering criteria at group level with the having clause in ms sql server?

563


Mention the differences between sql server and mysql.

512


Explain optimistic and pessimistic concurrency?

544


Difference between Logical Page and Physical Page in SSRS.

340


What do you mean by an execution plan? Why is it used?

535