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 Divide Query Output into Groups
How To Divide Query Output into Groups? - Oracle DBA FAQ - Understanding SQL SELECT Query Statements
✍: FYIcenter.com
You can divide query output into multiple groups with the GROUP BY clause. It allows you specify a column as the grouping criteria, so that rows with the same value in the column will be considered as a single group. When the GROUP BY clause is specified, the select statement can only be used to return group level information. The following script gives you a good GROUP BY example:
SQL> SELECT department_id, MIN(salary), MAX(salary),
2 AVG(salary) FROM employees GROUP BY department_id;
DEPARTMENT_ID MIN(SALARY) MAX(SALARY) AVG(SALARY)
------------- ----------- ----------- -----------
100 6900 12000 8600
30 2500 11000 4150
7000 7000 7000
90 17000 24000 19333.3333
20 6000 13000 9500
70 10000 10000 10000
110 8300 12000 10150
50 2100 8200 3475.55556
......
2007-04-20, 5709👍, 0💬
Popular Posts:
How to set a cookie with the contents of a textbox ? Values stored in cookies may not have semicolon...
What is the significance of Finalize method in .NET? .NET Garbage collector does almost all clean up...
What is page thrashing? Some operating systems (such as UNIX or Windows in enhanced mode) use virtua...
What is CAR (Causal Analysis and Resolution)? The basic purpose of CAR is to analyze all defects, pr...
How To Merge Cells in a Row? - XHTML 1.0 Tutorials - Understanding Tables and Table Cells If you wan...