Use of Oracle Partition by

Source: Internet
Author: User

Requirements: To find the largest line of Frecamount information in Fsendccname Group;

Solution 1:

SELECT T0. Fsendccname,t0. Frecccname
From tmp0ce8366758a811e781d70050568 T0
INNER JOIN
(SELECT fsendccname, MAX (frecamount) frecamount
From tmp0ce8366758a811e781d70050568
WHERE fgrouping = 0
GROUP by Fsendccname
ORDER by Fsendccname, Frecamount DESC) T1
On T1. Fsendccname = T0. Fsendccname
and T1. Frecamount = T0. Frecamount
WHERE T0. fgrouping = 0;

Solution 2:

-- Sort by order SELECT row_number () over (PARTITION by Fsendccname ORDER by Frecamount DESC)                  rn,               A. *           from tmp0ce8366758a811e781d70050568 a          WHERE = 0  and Fgrouplevel<>1

The results appear as follows:

Solution 3:

-- Jump Sort SELECT  over byORDERby DESC)                  RN,               A. *           from tmp0ce8366758a811e781d70050568 A          WHERE = 0  and Fgrouplevel<>1

The results appear as follows:

Solution 4:

-- Sequential sequencing SELECT  over byORDERby DESC)                  RN,               A. *           from tmp0ce8366758a811e781d70050568 A          WHERE = 0  and Fgrouplevel<>1

The results appear as follows:

Use of Oracle Partition by

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.