I have column values like A1,A20........A10. When I do an order by, the values are displayed as A1,A10, A2 and so on…
But, I want to display the columns in this format
A1
A2
A10
A20 and so on..
Can someone please tell me how do I achieve this sorting?
if the pattern of your column is just A-Z + some numbers, you could sort with
regexp_replace(id, '[0-9]', ''),the above just keeps “A”s first, then “B” etc. you can remove that if you don’t want to do that.
but if any row has any other non-numeric characters, the query would fail on invalid number.
eg: