Categories:
.NET (357)
C (330)
C++ (183)
CSS (84)
DBA (2)
General (7)
HTML (4)
Java (574)
JavaScript (106)
JSP (66)
Oracle (114)
Perl (46)
Perl (1)
PHP (1)
PL/SQL (1)
RSS (51)
Software QA (13)
SQL Server (1)
Windows (1)
XHTML (173)
Other Resources:
How To Apply Filtering Criteria at Group Level
How To Apply Filtering Criteria at Group Level? - Oracle DBA FAQ - Understanding SQL SELECT Query Statements
✍: 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
2007-04-20, 4574👍, 0💬
Popular Posts:
How to make elements invisible? Change the "visibility" attribute of the style object associated wit...
How did you implement UML in your project ? PART II Implementation phase / Coding phase (Class diagr...
What Happens If One Row Has Missing Columns? - XHTML 1.0 Tutorials - Understanding Tables and Table ...
How To Change the Password of Another User Account? - MySQL FAQs - Managing User Accounts and Access...
How To Decrement Dates by 1? - MySQL FAQs - Introduction to SQL Date and Time Handling If you have a...