Database - GROUP BY & HAVING


The GROUP BY statement is used in conjunction with the aggregate
 functions to group the result-set by one or more columns.


Syntax:
SELECT column_name, aggregate_function(column_name)
FROM table_name
WHERE column_name operator value
GROUP BY column_name




The HAVING clause was added to SQL because the WHERE keyword could
 not be used with aggregate functions.

Syntax:
SELECT column_name, aggregate_function(column_name)
FROM table_name
WHERE column_name operator value
GROUP BY column_name
HAVING aggregate_function(column_name) operator value

Comments

Popular posts from this blog

How to set Java Object into JaxBElement ?

GitLab