Collections:
Divide Query Output into Groups in Oracle
How To Divide Query Output into Groups in Oracle?
✍: FYIcenter.com
You can divide query output into multiple groups with the GROUP BY clause. It allows you specify a column as the grouping criteria, so that rows with the same value in the column will be considered as a single group. When the GROUP BY clause is specified, the select statement can only be used to return group level information. The following script gives you a good GROUP BY example:
SQL> SELECT department_id, MIN(salary), MAX(salary), 2 AVG(salary) FROM employees GROUP BY department_id; DEPARTMENT_ID MIN(SALARY) MAX(SALARY) AVG(SALARY) ------------- ----------- ----------- ----------- 100 6900 12000 8600 30 2500 11000 4150 7000 7000 7000 90 17000 24000 19333.3333 20 6000 13000 9500 70 10000 10000 10000 110 8300 12000 10150 50 2100 8200 3475.55556 ......
⇒ Apply Filtering Criteria at Group Level in Oracle
⇐ Group Functions Used with Non-group Selection Fields in Oracle
2019-11-21, 2189🔥, 0💬
Popular Posts:
How To Create a Table Index in Oracle? If you have a table with a lots of rows, and you know that on...
What is sqlservr.exe - Process - SQL Server (SQLEX?PRESS) in SQL Server? Process sqlservr.exe is the...
How to download Microsoft SQL Server 2005 Express Edition in SQL Server? Microsoft SQL Server 2005 E...
How To Get a List of All Tables with "sys.tables" View in SQL Server? If you want to see the table y...
What Are the Underflow and Overflow Behaviors on FLOAT Literals in SQL Server Transact-SQL? If you e...