Quantcast
Channel: Teradata Forums - All forums
Viewing all articles
Browse latest Browse all 27759

How to not to skip a RANK ? - response (5) by CarlosAL

$
0
0
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.  

Viewing all articles
Browse latest Browse all 27759

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>