mysql 字符串转数字

 一共有三种方式。

第一种:字符串 + 0

SELECT * FROM t_analyze_rfm_report where date = '2022-10-27' and crowd_size + 0 > 1000;

第二种: cast('字符串' as 数值类型)


SELECT * FROM t_analyze_rfm_report where date = '2021-10-27' and CONVERT(crowd_size,DECIMAL) > 1000;

 第三种:convert('字符串', 数值类型)



SELECT * FROM t_analyze_rfm_report where date = '2021-10-27' and CAST(crowd_size as DECIMAL) > 1000

你可能感兴趣的:(mysql,数据库,sql)