What is the difference between a HAVING CLAUSE and a WHERE
CLAUSE?
Answer Posted / ravindran
1.WHERE clause can be used with SELECT,INSERT and UPADATE statements,where as HAVING clause can only be used with the SELECT statements.
2.WHERE filter after rows before aggregation(GROUPING),
where as,HAVING filters groups,after the aggregations are performed.
3.Aggregate functions cannot be used in the WHERE clause,unless it is in a sub query containing in a HAVING clause,where as,aggregate functions can be used in having clause.
| Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
How will you find out if there are expensive SQL statements running or not?
Explain what is dbcc?
as a general practice, it is recommended to have dbo be the owner of all database objects however, in your database you find number of tables owned by a user other than dbo, how could you fix this? : Sql server administration
Tell me in brief how sql server enhances scalability of the database system?
Explain the microsoft sql server delete command? : SQL Server Architecture
Differentiate sql server reporting services vs. Crystal reports?
Why we use functions in sql server?
As per your opinion what are the five top responsibilities of a dba? : sql server database administration
What is lock escalation? : sql server database administration
What is the purpose of the master database?
It is important form e to get the information from log files of applications executed by the task scheduler? Does sql studio save these log files? : sql server management studio
How can windows applications connect to sql servers via odbc?
How to verify the port number of the sql server?
What is a table called, if it has neither cluster nor non-cluster index? What is it used for?
whats new about truncate in sql server 2008?