Oracle
 sql >> Database >  >> RDS >> Oracle

Utilizzando una procedura pl-sql o il cursore per selezionare i primi 3 ranghi

Prova questo....

select * from (
select customer,make,zipcode,offer, dense_rank() over (PARTITION by customer order by customer,make, zipcode,offer desc) Rank from tablename)
where Rank <4;