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, 1431🔥, 0💬
Popular Posts:
Is PL/SQL Language Case Sensitive in Oracle? PL/SQL language is not case sensitive: Reserved words a...
What Are the Underflow and Overflow Behaviors on FLOAT Literals in SQL Server Transact-SQL? If you e...
Why I Can Not Enter 0.001 Second in DATETIME values in SQL Server Transact-SQL? If you enter millise...
Where to find tutorials to answer some frequently asked questions on Microsoft SQL Server Transact-S...
How To Select All Columns of All Rows from a Table with a SELECT statement in SQL Server? The simple...