what is the difference between group and having
give an example with query and sample output

Answer Posted / manub22

- GROUP BY clause works on the rows returned by a SELECT Query. This clause summaries identical rows into a single/distinct group and returns a single row with the summary for each group, by using appropriate Aggregate function in the SELECT list, like COUNT(), SUM(), MIN(), MAX(), AVG(), etc.

- HAVING clause works as a Filter on top of the Grouped rows returned by the Query containing the GROUP BY clause. This clause cannot be replaced by a WHERE clause and vice-versa.

Check the difference b/w GROUP BY & HAVING, link: http://sqlwithmanoj.com/2015/05/23/sql-basics-difference-between-where-group-by-and-having-clause/

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

what is sql server? : Sql server database administration

540


Which are the two editions in which SQL Azure database available?

99


How to change the ownership of a schema in ms sql server?

563


What is the difference between clustered and non-clustered indexes in ms sql server?

491


Explain in brief about Microsoft SQL server?

547






State the difference between union and union all?

521


What are types of subqueries?

558


What do you know about normalization and de- normalization?

468


What is indexed view?

598


Explain full-text indexing?

515


Define right outer join in sql server joins?

517


How many joins in sql server?

516


How can we use ConnectorJ JDBC Driver with MS SQL?

566


mention different types of relationships in the dbms?

505


Explain about system database?

578