I have a column in my table that stores max 2 characters. For eg. B,AK,SE etc.
Suppose I have two rows in that table, one having 'K' and other having 'BA' as a value.
Requirement in my project is such that I have to get the maximum value from the table based on the no. of characters in case there is a difference in the length. In this case, maximum value will be 'BA' not 'K'.
But when I use 'order by column desc' with rownum = 1 in my query, 'K' is returned as rownum 0th value.
If I have values 'D','BA','AK','C' then output should be 'BA','AK','C','D' Just want to know if there is any way I can fulfill my requirement?
rownum = 0? don't you meanrownum = 1?