ABS

绝对值

# 绝对值 二进制
select val, abs(val) as abs, bin(val) as bin
from math_test;

BIN

10进制——>二进制

# 绝对值 二进制
select val, abs(val) as abs, bin(val) as bin
from math_test;

CEILING

向上取整

# 取整
select val, ceiling(val) as up, floor(val) as down
from math_test;

CONV

进制转换

# 进制转换
select val, conv(val, 10, 16) as conv
from math_test;

FLOOR

向下取整

# 取整
select val, ceiling(val) as up, floor(val) as down

FORMAT

保留小数

# 保留小数
select val, format(val, 1) as format
from math_test;

HEX

转十六进制

# 十六进制
select val, hex(val)
from math_test;

LEAST

求最小值

# 最小值
select val, least(val,3) as least
from math_test;

MOD

求余数

# 求余数
select val,mod(val,2)as mod_2
from math_test;

RAND

随机数

# 随机数
select rand()
from dual;

image.png

Q.E.D.


全栈混子的菜鸡日常