Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个列的 char 数据类型的表。需要从该列中获取最大数量。
该列中的一些值是 1,2,3,A,B
在获取最大值(列)时,我只得到字符 - 'B',我如何获得数值中的最大值? select max(cast(floor as int)) from floormaster
select max(cast(floor as int)) from floormaster
SELECT MAX(CAST(columnName AS INT)) MAX_VALUE FROM tableName WHERE ISNUMERIC(columnName) = 1
SQLFiddle 演示
数字()