In oracle, The row_number () over () analysis function row_number () over (partition by col1 order by col2) indicates grouping by col1 and sorting by col2 within the grouping, the value calculated by this function indicates the sequential numbers after sorting in each group (the sequential and unique values in the group ). The difference between rownum and rownum is that when rownum is used for sorting, it adds fake rownum to the result set before sorting, this function sorts the clause before calculating the row number. Row_number () is similar to rownum and more powerful (it can be sorted from 1 in each group ). Rank () is a skip sorting. When there are two second names, the next is the fourth (also in each group) dense_rank () is also a continuous sorting. When there are two second names, it is still followed by the third name. In contrast, row_number does not have repeated values. The oracle analysis function row_number () returns an integer (> = 1 );