14 mysql 的常见函数
数学函数
1 abs() 函数 ,返回绝对值
2 bin() 函数 ,返回数值的二进制数值
3 hex()函数 ,返回数值的十六进制的值
4 floor()函数 ,对小数取整,舍去取整。向下取整
5 rand()函数, 随机函数
6 ceiling()函数,向上取整
字符串函数
7 group_concat () 拼接字符串,默认使用","
8 ascii()函数,查看字符的ascii码
9 bit_length()函数,返回字符串的比特长度
10 length()函数,返回字符串的长度
11 char_length() 函数,返回字符长度
12 reverse() 函数,反转字符串。
13 position('',in,'') 函数 返回指定字符的位置。
14 right()函数,
日期函数
week()函数,返回参数日期在一年中的第几周。
current_date(); 返回当前日期,
now()函数 ,返回当前时间,年月日,时分秒
流程控制函数
1 case when then
2 if(参数1,2,3)
3 ifnull(表达式1,表达式 2)
系统调试函数
1 user();
2 version()