Quantcast
Channel: Teradata Forums - Database
Viewing all articles
Browse latest Browse all 14773

SQL question? - response (1) by dnoeth

$
0
0

Simply write your condition into the RANK:

qualify
   rank() 
   over (partition by CAD.CUST_ACCT_KEY or whatever you need
         order by case 
                     WHEN RCVR_TYPE_DESC = 'AAA' THEN 1
                     WHEN RCVR_TYPE_DESC = 'BBB' THEN 2
                     WHEN RCVR_TYPE_DESC = 'CCC' THEN 3
                     WHEN RCVR_TYPE_DESC = 'DDD' THEN 4
                   end
        ) = 1

 
Dieter


Viewing all articles
Browse latest Browse all 14773

Trending Articles



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