How to Work with HAVING Clause in SQL
In this article I am going to explain how to work with HAVING Clause in SQL.
In this article I am going to explain how to work with HAVING Clause in SQL. GROUP BY clause is used to groups the rows of result set based on one or more columns or expression. GROUP BY clause is used in SELECT statements that include aggregate functions.
To put any condition with group by clause we use HAVING clause. HAVING clause is used to specify a search condition for a group or an aggregate.
SELECT vendorid, sum(invoicetotal)
group by vendorid
having sum(invoicetotal) > 1200
order by sum_invoicetotal desc