How to Work with GROUP BY Clause in SQL
In this article I am going to explain how to work with GROUP BY Clause in SQL.
In this article I am going to explain how to work with GROUP BY 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
order by sum_invoicetotal desc