Row_number () over () analysis function in oracle

Source: Internet
Author: User

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 );

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.