What is the difference between HAVING clause and the WHERE
clause?
Answer Posted / mayursinh zala
'Where' clause applies to the individual rows whereas 'Having' clause is used to test some condition on the group(usually aggregate methods) rather than on individual rows.
Specifies a search condition for a group or an aggregate. HAVING can be used only with the SELECT statement. HAVING is typically used in a GROUP BY clause. When GROUP BY is not used, HAVING behaves like a WHERE clause.
So you can use having WITHOUT group by clause. This is a sample, although it might make no sense of business value:
select max(state) from States having count(State) > 60
Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
What is similarity and difference between truncate and delete in sql?
How can I get data from a database on another server?
Introduction of rollup clause using sum and group by clause?
how you can move data or databases between servers and databases in sql server? : Sql server administration
What are the restrictions applicable while creating views? : SQL Server Architecture
What is the maximum size per database for sql server express?
What is ems sql management studio? : sql server management studio
What is the difference between ddl,dml and dcl commands?
What is global temp table?
How can we delete a table in sql server?
What are “lock” hints?
Can we use where clause in union?
What are the five major components of a dbms?
You want to implement the one-to-many relationship while designing tables. How would you do it?
What does truncate do?