sql - Oracle: max value column alphanumeric -


the problem can not latest code. need generate next.

example:

 last:  d11.0602.166   next:  d11.0603.166 

i've tried:

 max  translate  convert  mid  val 

what have there "smart key" - 1 attribute comprising 3 elements. smart keys dumb, because they're pain in tha neck work with.

so correct solution split attribute 3 separate attributes , make composite key instead.

in meantime use reguklar expressions fin dthe highest value of middle component...

select max(regexp_replace(dumb_key                , '([a-z][0-9]{2})\.([0-9]{4})\..([0-9]{3})'                , '\2')) your_table / 

no doubt there sorts of other complexities haven't explained, means isn't compleat solution. should starter ten.


Comments

Popular posts from this blog

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -

node.js - Bad Request - node js ajax post -