Collections:
Use Group Functions in the SELECT Clause in Oracle
How To Use Group Functions in the SELECT Clause in Oracle?
✍: FYIcenter.com
If group functions are used in the SELECT clause, they will be used on the rows that meet the query selection criteria, the output of group functions will be returned as output of the query. The following select statement returns 4 values calculate by 4 group functions on all rows of the "departments" table:
SQL> SELECT COUNT(*), MIN(department_id), 2 MAX(department_id) FROM departments; COUNT(*) MIN(DEPARTMENT_ID) MAX(DEPARTMENT_ID) ---------- ------------------ ------------------ 27 10 270
2016-10-17, 461👍, 0💬
Popular Posts:
How to execute statements under given conditions in SQL Server Transact-SQL? How to use IF ... ELSE ...
How to put statements into a statement block in SQL Server Transact-SQL? You can put statements into...
How To Format Time Zone in +/-hh:mm Format in SQL Server Transact-SQL? From the previous tutorial, y...
Can You Create a View with Data from Multiple Tables in SQL Server? Can You Create a View with Data ...
How To Convert Numeric Values to Integers in SQL Server Transact-SQL? Sometimes you need to round a ...