MySQL: 数学函数

2022/4/5 19:19:36

本文主要是介绍MySQL: 数学函数,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!

select abs(-5) from dual;
select bin(10) from dual;  # 转二进制 1010
select hex(100) from dual;
select conv(number,from_base,to_base)
select ceil(n)
select floor(n)
select format(n,保留小数位)
select least(n1,n2,...)
select mod(10,4) from dual;  # module
select rand()  # [0,1)
select rand(seed)  # seed不变,结果不变

 

https://dev.mysql.com/doc/refman/8.0/en/mathematical-functions.html



这篇关于MySQL: 数学函数的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!


扫一扫关注最新编程教程