Oracle basic query to view rankings

Source: Internet
Author: User
1-method 1 for finding the top 6-10 employees: selectemployee, salaryfrom (selectemployee, salary, row_number () over (orderby

1-evaluate the top 6-10 employees: select employee, salary from (select employee, salary, row_number () over (order

1-find the top 6-10 employees

Method 1:

Select employee, salary
From (
Select employee, salary, row_number () over (order by salary desc) r
From salary_table
)
Where r between 6 and 10;

==============================================

Method 2:
Select employee, salary
From (
Select employee, salary, rank () over (order by salary desc) r
From salary_table
)
Where r between 6 and 10;

For more information about Oracle, see the Oracle topic page? Tid = 12

,

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.