what is the order of execution of where,having,group by in
select stement
Answers were Sorted based on User's Feedback
Answer / 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 |
Answer / shivaraj
Execution-1- WHERE
Execution-2- GROUP BY
Execution-3- HAVING
| Is This Answer Correct ? | 26 Yes | 2 No |
Answer / lakshmi
from clause
where
group by
having
distinct
order by
select
| Is This Answer Correct ? | 2 Yes | 5 No |
Answer / bhagyashri jain
First of all,
when Group by and having clauses are there , the Where
clause can't present there, so order of group by, having is
respectively
Group by
Having
| Is This Answer Correct ? | 6 Yes | 20 No |
What command do we use to rename a db, a table and a column?
What guidelines should be followed to help minimize deadlocks?
What's the difference between DELETE TABLE and TRUNCATE TABLE commands?
What is sql server profiler trace data file?
In the primary key have a multiple field or not?
You want to check the syntax of a complicated update sql statement without executing it. What command should you use?
What is a derived table?
Tell me in brief how sql server enhances scalability of the database system?
How to delete duplicate records from a table?(for suppose in a table we have 1000 Records in that we have 200 duplicate Records , so ,how to findout that duplicate Records , how to delete those Records and arranged into sequence order? one more thing that there is no primary key at all)
How to create a view and a stored procedure in ms sql server using "create view/procedure" statements?
What is exclusive locks?
as a part of your job, what are the dbcc commands that you commonly use for database maintenance? : Sql server database administration
Oracle (3259)
SQL Server (4518)
MS Access (429)
MySQL (1402)
Postgre (483)
Sybase (267)
DB Architecture (141)
DB Administration (291)
DB Development (113)
SQL PLSQL (3330)
MongoDB (502)
IBM Informix (50)
Neo4j (82)
InfluxDB (0)
Apache CouchDB (44)
Firebird (5)
Database Management (1411)
Databases AllOther (288)