sql - Retrieve maximum number from alphanumeric column -


please can me sql query how maximum number alphanumeric field. below code field. can see want retrieve highest number oss 120. in advance.

asg1 asg10 asg14 asg2 asg21 asg4 lts1 lts10 lts14 lts2 lts21 lts4 oss1 oss10 oss100 oss11 oss114 oss120 oss2 oss21 oss3 oss4 oss5 oss6 oss7 

you can use regular expression this. work every length of string , number.

    select column_name table_name       regexp_replace(column_name,'[a-za-z]','')=            (select max(to_number(regexp_replace(column_name,'[a_za-z]','')))                  table_name) 

Comments

Popular posts from this blog

php - Wordpress website dashboard page or post editor content is not showing but front end data is showing properly -

javascript - Get parameter of GET request -

javascript - Twitter Bootstrap - how to add some more margin between tooltip popup and element -