对MySQL进行精度处理时发现format,只能逐个字符比较。
后搜索到:
format()函数返回的是字符串,满三位会加一个逗号。无法按照数字方式排序,只能字符比较
针对数字类型转换建议使用 convert或者cast函数,用法如下:
convert(param, decimal(20,2))
cast(param as decimal(20,2))
对MySQL进行精度处理时发现format,只能逐个字符比较。
后搜索到:
format()函数返回的是字符串,满三位会加一个逗号。无法按照数字方式排序,只能字符比较
针对数字类型转换建议使用 convert或者cast函数,用法如下:
convert(param, decimal(20,2))
cast(param as decimal(20,2))