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:
Can Multiple Columns Be Used in GROUP BY
Can Multiple Columns Be Used in GROUP BY? - Oracle DBA FAQ - Understanding SQL SELECT Query Statements
✍: FYIcenter.com
You can use multiple columns in the GROUP BY clause as shown in the following example. It returns how many employees are having the same salary in each department:
SQL> SELECT department_id, salary, count(*)
2 FROM employees GROUP BY department_id,
3 salary HAVING count(*) > 1;
DEPARTMENT_ID SALARY COUNT(*)
------------- ---------- ----------
90 17000 2
50 3200 4
50 2200 2
50 3600 2
80 10500 2
80 9000 2
50 2700 2
......
2007-04-20, 5265👍, 0💬
Popular Posts:
What's wrong with this initialization? char *p = malloc(10); My compiler is complaining about an ``i...
What does a well-written Object Oriented program look like? A well-written object oriented program e...
How To Change System Global Area (SGA)? - Oracle DBA FAQ - Introduction to Oracle Database 10g Expre...
Can Multiple Cursors Being Opened at the Same Time? - Oracle DBA FAQ - Working with Cursors in PL/SQ...
What are the types of variables x, y, y and u defined in the following code? #define Atype int* type...