Oracle Aggregate functions --- percent_rank () and cume_dist () Specify the relative position of the grouping Sequence

Source: Internet
Author: User


Oracle Aggregate functions --- percent_rank () and cume_dist () Specify the relative position of the grouping sequence PERCENT_RANK (expr [, expr]...) within group (order by expr [DESC | ASC] [NULLS {FIRST | LAST}] [, expr [DESC | ASC] [NULLS {FIRST | LAST}]...) returns the relative position of the specified data in the specified group sequence. This value is considered part of the sequence regardless of whether the specified value is repeated or not. SQL code select percent_rank (2975) within group (order by scott. emp. sal) from scott. emp www.2cto.com CUME_DIST (expr [, expr]...) within group (ORDER B Y expr [DESC | ASC] [NULLS {FIRST | LAST}] [, expr [DESC | ASC] [NULLS {FIRST | LAST}]...) query the relative position of a specified value in a specified group sequence. The returned value is a small value between 0 and 1. If the specified value is the same as a value in the group sequence, the binary value is treated as a value. SQL code select cume_dist (2975) within group (order by scott. emp. sal) from scott. emp

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.