#演示数学相关函数
#1.ABS(num):绝对值
SELECT ABS(-10) FROM DUAL;
#2.BIN(num):十进制转二进制
SELECT BIN(10) FROM DUAL;
#3.CEILING(num):向上取整,得到比num大的最小整数
SELECT CEILING(-10.25) FROM DUAL;
#4.FLOOR(num):向下取整,得到比num小的最大整数
SELECT FLOOR(-10.23) FROM DUAL;
#5.CONV(num,from_base,to_base):进制转换
SELECT CONV(10,2,10) FROM DUAL;
#6.FORMAT(num,decimal_places):保留小数位数(四舍五入)
SELECT FORMAT(-10.264245,5) FROM DUAL;
#7.HEX(DecimalNumber):转十六进制
SELECT HEX(31) FROM DUAL;
#8.least(num1,num2...):求最小值
SELECT LEAST(10,20,12,25) FROM DUAL;
#9.MOD(numerator,denominator):求余
SELECT MOD(10,3) FROM DUAL;
#10.RAND([seed]):返回随机数,其范围为0-1.0,如果添加seed,seed不变则随即数不变
SELECT RAND(5) FROM DUAL;
SELECT RAND(5) FROM DUAL;