Call now: 252-767-6166  
Oracle Training Oracle Support Development Oracle Apps

 
 Home
 E-mail Us
 Oracle Articles
New Oracle Articles


 Oracle Training
 Oracle Tips

 Oracle Forum
 Class Catalog


 Remote DBA
 Oracle Tuning
 Emergency 911
 RAC Support
 Apps Support
 Analysis
 Design
 Implementation
 Oracle Support


 SQL Tuning
 Security

 Oracle UNIX
 Oracle Linux
 Monitoring
 Remote s
upport
 Remote plans
 Remote
services
 Application Server

 Applications
 Oracle Forms
 Oracle Portal
 App Upgrades
 SQL Server
 Oracle Concepts
 Software Support

 Remote S
upport  
 Development  

 Implementation


 Consulting Staff
 Consulting Prices
 Help Wanted!

 


 Oracle Posters
 Oracle Books

 Oracle Scripts
 Ion
 Excel-DB  

Don Burleson Blog 


 

 

 


 

 

 

 
 

Oracle SQL "partition" Analytic Function tips

Oracle Tips by Laurent Schneider

 

Laurent Schneider is considered one of the top Oracle SQL experts, and he is the author of the book "Advanced Oracle SQL Programming" by Rampant TechPress.  The following is an excerpt from the book.

PARTITION

As the aggregate functions use GROUP BY to group rows, analytic functions use PARTITION BY. 

SELECT
   ENAME,
   SAL,
   DEPTNO,
   MAX(SAL) OVER (PARTITION BY DEPTNO) MAX_SAL_DEPTNO,
   JOB,
   MAX(SAL) OVER (PARTITION BY JOB) MAX_SAL_JOB
FROM
   EMP;

ENAME             SAL     DEPTNO MAX_SAL_DEPTNO JOB       MAX_SAL_JOB
---------- ---------- ---------- -------------- --------- -----------
MILLER           1300         10           5000 CLERK            1300
KING             5000         10           5000 PRESIDENT        5000
CLARK            2450         10           5000 MANAGER          2975
SMITH             800         20           3000 CLERK            1300
SCOTT            3000         20           3000 ANALYST          3000
ADAMS            1100         20           3000 CLERK            1300
FORD             3000         20           3000 ANALYST          3000
JONES            2975         20           3000 MANAGER          2975
WARD             1250         30           2850 SALESMAN         1600
MARTIN           1250         30           2850 SALESMAN         1600
TURNER           1500         30           2850 SALESMAN         1600
ALLEN            1600         30           2850 SALESMAN         1600
JAMES             950         30           2850 CLERK            1300
BLAKE            2850         30           2850 MANAGER          2975

Miller is the clerk of department 10. In his department, the best paid employee has a salary of 5000. Over all clerks, his salary of 1300 is the highest.  The PARTITION BY reduces the scope to the current partition.

 


 

 

��  
 
 
Oracle Training at Sea
 
 
 
 
oracle dba poster
 

 
Follow us on Twitter 
 
Oracle performance tuning software 
 
Oracle Linux poster
 
 
 

 

Burleson is the American Team

Note: This Oracle documentation was created as a support and Oracle training reference for use by our DBA performance tuning consulting professionals.  Feel free to ask questions on our Oracle forum.

Verify experience! Anyone considering using the services of an Oracle support expert should independently investigate their credentials and experience, and not rely on advertisements and self-proclaimed expertise. All legitimate Oracle experts publish their Oracle qualifications.

Errata?  Oracle technology is changing and we strive to update our BC Oracle support information.  If you find an error or have a suggestion for improving our content, we would appreciate your feedback.  Just  e-mail:  

and include the URL for the page.


                    









Burleson Consulting

The Oracle of Database Support

Oracle Performance Tuning

Remote DBA Services


 

Copyright © 1996 -  2020

All rights reserved by Burleson

Oracle ® is the registered trademark of Oracle Corporation.