Hi.
You could try something like:
SELECT a.Store_Item,
a.Sales,
b.The_rank
FROM YOUR_TABLE a,
( SELECT c.Sales ,
row_number() OVER (ORDER BY c.Sales DESC) The_Rank
FROM ( SELECT DISTINCT Sales FROM YOUR_TABLE ) c
QUALIFY The_Rank <= 100
) b
WHERE a.Sales = b.Sales
ORDER BY b.The_Rank;
HTH.
Cheers.
Carlos.
↧