当前位置: 动力学知识库 > 问答 > 编程问答 >

sql - How to find max value from alphanumeric string on the basis of numeric value in db2

问题描述:

I am working on db2 database.I want to get max value from a column.That column is of varchar type and has alphanumeric values such as

abc100

, abc101

,abc102......

I want to get 'abc102' as a result.

Thanks in advance.

网友答案:

Use max():

select max(col)
from t;

Your data is such that the alphabetical maximum is what you are looking for.

分享给朋友:
您可能感兴趣的文章:
随机阅读: