Group By

Group By:
SQL- Group By clause, deals with aggregate functions on the column names of a table. It consolidates and calculates column values into a single record value. GROUP BY requires a list of table columns on which to run the calculations. We can also use the GROUP BY statement on more than one column. It will return unique values. Hence it inherits the behavior of “SELECT DISTINCT “command.

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

0 comments:

Post a Comment

Blogger news