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 illustrate physical database architecture? : SQL Server Architecture
How do I clean up sql server transaction log?
What is the use of commit?
What are the system database in sql server 2008?
What is fill factor and pad index?
How to compare the top two records using sql?
Write an sql query for deleting duplicate rows?
How to use column default values in insert statements in ms sql server?
What is bcp? When does it use?
Is sql server implemented as a service or an application? : Sql server database administration
Define views.
How to generate create function script on an existing function?
When a primary key constraint is included in a table, what other constraints does this imply?
Explain the use of containers in ssis and also their types?
How to create a view using data from another view?