select max(cast(MONITOR_GROUP_ID as decimal)) fresh_no from ca_MONITOR_GROUP_INFO
CAST(expr AS type), CONVERT(expr,type), CONVERT(expr USING transcoding_name) The CAST() and CONVERT() functions take a value of one type and produce a value of another type. The type can be one of the following values: BINARY[(N)] CHAR[(N)] DATE DATETIME DECIMAL SIGNED [INTEGER] TIME UNSIGNED [INTEGER]
MONITOR_GROUP_ID as int换成char , mysql与sqlserver是不同 , 他不能直接转换为数值形式 如要转 可以用replace
select cast(max(MONITOR_GROUP_ID) as UNSIGNED),fresh_no from ca_MONITOR_GROUP_INFO;
select convert(max(MONITOR_GROUP_ID) as UNSIGNED),fresh_no from ca_MONITOR_GROUP_INFO;试试
如要转
可以用replace