Collections:
Apply Filtering Criteria at Group Level in Oracle
How To Apply Filtering Criteria at Group Level in Oracle?
✍: FYIcenter.com
If you want to return only specific groups from the query, you can apply filtering criteria at the group level by using the HAVING clause inside the GROUP BY clause. The following script gives you a good HAVING example:
SQL> SELECT department_id, MIN(salary), MAX(salary), 2 AVG(salary) FROM employees GROUP BY department_id 3 HAVING AVG(salary) < 5000; DEPARTMENT_ID MIN(SALARY) MAX(SALARY) AVG(SALARY) ------------- ----------- ----------- ----------- 30 2500 11000 4150 50 2100 8200 3475.55556 10 4400 4400 4400
⇒ Count Duplicated Values in a Column in Oracle
⇐ Divide Query Output into Groups in Oracle
2019-11-21, 1421🔥, 0💬
Popular Posts:
What To Do If the StartDB.bat Failed to Start the XE Instance in Oracle? If StartDB.bat failed to st...
How To List All Stored Procedures in the Current Database in SQL Server Transact-SQL? If you want to...
How To Format Time Zone in +/-hh:mm Format in SQL Server Transact-SQL? From the previous tutorial, y...
How To Start Instance with a Minimal Initialization Parameter File in Oracle? The sample initializat...
What are binary literals supported in SQL Server Transact-SQL? Binary literals in Transact-SQL are s...