本文介绍了具有Character数据类型的SQL Max函数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
大家好
我在一个字段中存储数字值,例如1,23 ... 99,并且该字段具有字符数据类型.
我需要此字段的最大值,但由于字符数据类型,它没有返回正确的值.
如果您有任何建议,请告诉我.
预先感谢
Hello everybody
I am storing number values like 1,23...99 in a field, and this field have character data type.
I need max value from this field but due to character data type it is not returning correct value.
If u have any suggestion then please tell me..
Thanks in advance
推荐答案
SELECT MAX(CAST(dat as int)) FROM myTable
这篇关于具有Character数据类型的SQL Max函数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!