数学floor()向下取整ceil()向上取整round(,)四舍五入truncate(,)不四舍五入mod(,)取余数abs()绝对值power(,)次方pi()圆周率六位rand()随机数sign()大于0返回1,小于0返回-1,否则为0exp() e的几次方字符串char_length()字符数length()字符串长度concat()拼接字符串,包含Null,则返回值就是nullconcat_wa()以指定分隔符拼接字符串concat_wa(null,’’,’’) 返回nullconcat_wa(’-’,‘a’,‘b’,null) 返回a-bupper()=ucase() 转大写lower()=lcase() 转小写reverse() 转换大小写left(,)|right(,)字符串前几个|后几个字符lpad(x,y,z)|rpad(x,y,z) x按y长度在前|后添加z字符trim()|ltrim()|rtrim() 去空格repeat(,次数) 重复指定次数replace(x,y,z)x字符串把y字符串替换为zsubstring(x,y,z) x字符串从y开始截取z长度,y从1开始strcmp(x,y)字符串比较日期时间curdate()=current_date()当前日期curtime()=current_time()当前时间now()=current_timestamp()=sysdate()当前日期和时间month(curdate())当前月份monthname(curdate())当前月份的名字dayname()周几名字dayofweek()周几,周天为1week(now())一年中第几周year/month/day/hour/minute/second年月日时分秒datediff() 两个日期相差天数date_format(日期,"%Y%m%d")其他version()版本connection_id()连接数database()=schema()当前数据库user()=current_user()=system_user()=session_user()当前用户last_insert_id()当前表的上一次auto_increment值md5() password()加密format(数字,2)千分位表示并只保留两位小数