![]() |
|||
|
![]() |
![]() |
|
FULL A - Z Oracle Function Library (formerly named "Morgan's Library")
![]() Term: MAX
Definition: MAX(expression) OVER (analytic clause) Example Usage: The SQL statement below retrieves maximum employee id (EMPNO) from the EMPLOYEE table. SELECT MAX(EMPNO) FROM EMPLOYEE; The SQL statement below retrieves the maximum salary in each department from EMPLOYEE table. This demonstrates the aggregate behavior of MAX. SELECT DEPTNO, MAX(SALARY) The SQL statement below also retrieves the maximum salary per department from EMPLOYEE table, but without using GROUP_BY clause. This shows the analytic behavior of MAX. SELECT DISTINCT DEPTNO, MAX(SALARY) OVER (PARTITION BY DEPTNO) Related Links:
Related Code Snippets:
![]() ![]() |
![]() |
Home | Search | Code Library | Sponsors | Privacy | Terms of Use | Contact Us | © 2003 - 2025 psoug.org |