We are migrating from oracle to teradata, and got stuck with dense_rank function, please any suggestions would be appreciate.
Here is our query in oracle:
Refer to page
here 3 methods are provided.
Keep outer join outside and not in derived table.
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 :-)