sql select group by having





"SELECT statements" is the standard SQL SELECT command query."[HAVING condition]" is optional it is used to restrict the rows affected by the GROUP BY clause. Groups a selected set of rows into a set of summary rows by the values of one or more columns or expressions in SQL Server 2008 R2.Aggregate functions in the SELECT clause