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

replacement of dense_rank function in oracle - response (2) by dnoeth

$
0
0

Of course this is not correct, you use two columns in the ORDER BY, but the MIN(STATE) is only a single column.
Go to Harpeet's link and change the code to the 2nd version based on 
ROW_NUMBER() OVER (ORDER BY STATE, COALESCE(columnA, 'Other'))
And better keep the outer join, otherwise you'll get a different result :-)
Dieter


Viewing all articles
Browse latest Browse all 27759

Trending Articles



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