Professional Documents
Culture Documents
It
typically used in select statement that include aggrate function the aggregrate is calculated for each set
of value that result from the column named in the group the clause.
A group by list typically consists of the names one or more columns seprarted by comma.
The having clause specifies a search condition for a group are an aggregate. This condition is apply after
the rows that satisfy the search condition in the where clause or group.
Syntax:
SELECT select-list
from Tablename
[group by group-list]
1.When you include a where clause in a select statement that uses grouping and aggregates, the search
condition is applied before the rows or groups and the aggregates are calculated. That way only the
rows that satisfy the search conditions and group are summarise.
1.When you incliuded a have clause in a select statement the uses grouping and aggregates, the search
condition is applied after the rows or groups and the aggregates are calculated. That way only the
groups that satisfy the searc h conditions are included in the result set.
2.A having clause can only refer to a column included in a select or grop by clause.
2.A where clause can refer to any column in the base table.
http://www.amulyam.in/dsQuizN.do?quizId=133782&name=Cricket