SQL query for repeating rows
657644Apr 28 2009 — edited Apr 29 2009Hi 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