Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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

How to convert numeric expression data types by assignment operations?

1062


What are the advantages of using third-party tools?

986


Write a query to include a constraint, to check whether the employee salary is greater than 5000?

1598


How does the report manager work in SSRS?

148


explain declarative management framework (dmf) in sql server 2008?

982


What is shared lock?

895


What is federation member?

114


What are the different types of cursor?

1087


Explain indexed views?

967


Difference between Inner vs outer joins?

942


Name and describe few console utilities for ssrs?

284


To automatically record the time on which the data was modified in a table, which data type should you choose for the column?

956


What is the syntax to execute the sys.dm_db_missing_index_details?

1016


how to create “alternate row colour”?

146


What are the approximate numeric data types?

923