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


Please Help Members By Posting Answers For Below Questions

To automatically record the time on which the data was modified in a table, which data type should you choose for the column?

628


What is normalization process?

686


Can another user execute your local temporary stored procedures?

624


plss anybody specify tha constrian management system in dbms

1685


Why normalization is used?

635






I have all the primary data files, secondary data files as well as logs. Now, tell me can I still restore the database without having a full backup? : sql server database administration

776


is it important for a database administrator to understand the operating system and file access? : Sql server administration

664


What is enhanced database mirroring in sql server 2008?

589


What is 2nf normalization?

637


What is subquery? Explain the properties of a subquery?

596


What is the difference between stored procedure and functions?

680


What is partition in sql server?

622


What is key set driven?

616


What is data mart? : sql server analysis services, ssas

690


Explain indexed views?

648