Categories:
.NET (961)
C (387)
C++ (185)
CSS (84)
DBA (8)
General (31)
HTML (48)
Java (641)
JavaScript (220)
JSP (109)
JUnit (31)
MySQL (297)
Networking (10)
Oracle (562)
Perl (48)
Perl (9)
PHP (259)
PL/SQL (140)
RSS (51)
Software QA (28)
SQL Server (5)
Struts (20)
Unix (2)
Windows (3)
XHTML (199)
XML (59)
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, 4447👍, 0💬
Popular Posts:
How can I include comments in HTML? An HTML comment begins with "<!--", ends with "-->...
How To Process Query Result in PL/SQL? - Oracle DBA FAQ - Introduction to PL/SQL You can run queries...
How can I implement a thread-safe JSP page? You can make your JSPs thread-safe by having them implem...
How To Insert Multiple Rows with a SELECT Statement? - MySQL FAQs - Managing Tables and Running Quer...
How To Set Background to Transparent or Non-transparent? - CSS Tutorials - HTML Formatting Model: Bl...