Advanced Functions of SQL
Advanced Functions of SQL
• 1) Count()
• 2) Sum()
• 3) Avg()
• 4) Min()
• 5) Max()
SQL - Having Clause
• The HAVING Clause enables you to specify conditions that filter which group results
appear in the results.
• The WHERE clause places conditions on the selected columns, whereas the HAVING
clause places conditions on groups created by the GROUP BY clause.
• Syntax
• SELECT
• FROM
• WHERE
• GROUP BY
• HAVING
• ORDER BY
Having and Group By
• The HAVING clause must follow the GROUP BY clause in a query and must
also precede the ORDER BY clause if used. The following code block has the
syntax of the SELECT statement including the HAVING clause −