CAST() 函数
程序员文章站
2022-07-05 16:13:36
作用: 四舍五入 SELECT CAST('9.0' AS DECIMAL) FROM DUAL; -- 9 SELECT CAST('9.5' AS DECIMAL) FROM DUAL; -- 10 SELECT CAST('9.6' AS DECIMAL) FROM DUAL; -- 10 S ......
作用: 四舍五入
select cast('9.0' as decimal) from dual; -- 9
select cast('9.5' as decimal) from dual; -- 10
select cast('9.6' as decimal) from dual; -- 10
select cast('9.3' as decimal) from dual; -- 9
select cast('9.5' as decimal(10,3)) from dual; -- 9.500
上一篇: 香肠要烤多久才熟?香肠和腊肠的区别?