Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

SQL query for repeating rows

657644Apr 28 2009 — edited Apr 29 2009
Hi I joined two table and created the new table called FMW_ANALY. Which has some repeating rows. I used the following Query to list the top 10 customers by value

SELECT *
FROM
(SELECT CUSTOMER, OPP_VALUE, RANK() OVER (order by OPP_VALUE DESC) opp_val_rank
FROM FMW_ANALY)
WHERE opp_val_rank<=10;

I'm getting the following result

Customer Opp Value Opp Val Rank
Department of Education and Training 8991776.99 1
Department of Education and Training 8991776.99 1
Department of Education and Training 8991776.99 1
Department of Education and Training 8991776.99 1
Department of Education and Training 8991776.99 1
Department of Education and Training 8991776.99 1
Department of Education and Training 8991776.99 1
Department of Education and Training 8991776.99 1
Department of Education and Training 8991776.99 1
Department of Education and Training 8991776.99 1
Department of Education and Training 8991776.99 1
Department of Education and Training 8991776.99 1
Department of Education and Training 8991776.99 1
Department of Education and Training 8991776.99 1
Department of Education and Training 8991776.99 1
Investments Commission 7447419.84 22
Bank Limited 4803000 23
Bank Limited 4803000 23
Bank Limited 4803000 23
Bank Limited 4803000 23
Bank Limited 4803000 23
Bank Limited 4803000 23
Bank Limited 4803000 23
Bank Limited 4803000 23

How can I Query without these repeating rows?

Thank you
Vick
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 9 2023
Added on Apr 28 2009
8 comments
624 views