What is the difference between having and where clause?
Answers were Sorted based on User's Feedback
where clause used to impose conditions in any dml operation
ex:
selct * from emp where empid=10
having clause used to impose conditions on group data
ex:
select sum(sal),avg(sal),count(*) from emp
having avg(sal)>2000
| Is This Answer Correct ? | 9 Yes | 0 No |
Answer / sd
Where clause operates on the selection before the rows are
actually grouped.
Hence , Try to add as many condition as possible in where
clause instead of having to boost the SQL query performance.
| Is This Answer Correct ? | 8 Yes | 2 No |
Answer / vinay singh
We can't use Where clause with aggregate function and Having
clause always use with aggregate function.
**Vinay Singh
| Is This Answer Correct ? | 6 Yes | 2 No |
Answer / kundan ravi
having clause alwaye use with aggregate functions and where
clause use for conditions but not with aggregate functions.
| Is This Answer Correct ? | 2 Yes | 3 No |
What is clustered index
How to find out name of all employees who has salary less than 200 Rs.?
is there more the two primary key in a single table?
26 Answers Eforce, Systematix,
explain different types of backups avaialabe in sql server? : Sql server database administration
How to Create Login and User through query in Sql server 2005.and also how to delete Login and User through query?
What is Covering Indexes? Plz explain with example
What is the difference between a HAVING CLAUSE and a WHERE CLAUSE?
11 Answers World Tech, Yardi Software,
What is the tcp/ip port on which sql server runs?
After using delete statement in sql query to delete some records...to retrieve the deleted records we can get using rollback command but till that where it stores means particular location name i need....(after deleting and rollback )
3 Answers CarrizalSoft Technologies, iGate,
How is sql server used?
What is the use of =,==,=== operators?
What is a heap?
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)