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
How to convert numeric expression data types by assignment operations?
What are the advantages of using third-party tools?
Write a query to include a constraint, to check whether the employee salary is greater than 5000?
How does the report manager work in SSRS?
explain declarative management framework (dmf) in sql server 2008?
What is shared lock?
What is federation member?
What are the different types of cursor?
Explain indexed views?
Difference between Inner vs outer joins?
Name and describe few console utilities for ssrs?
To automatically record the time on which the data was modified in a table, which data type should you choose for the column?
What is the syntax to execute the sys.dm_db_missing_index_details?
how to create “alternate row colour”?
What are the approximate numeric data types?