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

Please illustrate physical database architecture? : SQL Server Architecture

937


How do I clean up sql server transaction log?

993


What is the use of commit?

954


What are the system database in sql server 2008?

975


What is fill factor and pad index?

953


How to compare the top two records using sql?

1267


Write an sql query for deleting duplicate rows?

952


How to use column default values in insert statements in ms sql server?

970


What is bcp? When does it use?

871


Is sql server implemented as a service or an application? : Sql server database administration

894


Define views.

961


How to generate create function script on an existing function?

1043


When a primary key constraint is included in a table, what other constraints does this imply?

938


Explain the use of containers in ssis and also their types?

908


How to create a view using data from another view?

903