Analysis of Oracle Analysis Function

xiaoxiao2021-03-06  86

Dense_rank (), Rank () Difference Description: Dense_Rank (), Rank () is an Oracle's own analysis function, often used to establish a sequence of a certain field within a group after packet, their difference is the same Different processing of field values

example:

Select Deptno, CName, Sal (Partition by Deptno Order By Sal (Partition By Deptno Order By Sal Desc) R from Emp Order by DePtno, Sal Desc /

result:

DEPTNO ENAME SAL DR R ----------------------------- ----- 10 king 5000 1 1 10 Clark 2450 2 2 10 Miller 1300 3 3 20 Scott 3000 1 20 Ford 3000 1 1 20 Jones 2975 2 3 20 ADAMS 1100 3 4 30 Blake 2850 1 1 30 Turner 1500 2 2 30 WARD 1250 3 3 30 Martin 1250 3 3 30 James 950 4 5 30 Allen 600 5 6

Analysis Function Windows clause

The field analysis of the RANGE must be a date or a digital, according to the current analytical row value, the operation ROWS field can be any type, the number of physical numbers

Sepcific word in the Windows clause

After the unbounded preceding starts from the first row of the current partition, ending the current row current row that is being processed From the current row (and end) Numeric Expression preceding, starting Numeric Expression Following from the current line before quastern The current row until the digital expression after the current row ends BetWeen Numeric Expression1 and Numeric Expression2 Following is within the range of two numbers in the current behavior

转载请注明原文地址:https://www.9cbs.com/read-123059.html

New Post(0)