mysql函数总结

来源:互联网 发布:中国乐队 知乎 编辑:程序博客网 时间:2024/06/06 00:35

说明:本文只是总结常用的MySQL函数,没有例子。

字符函数:

lower(),upper(),concat(),concat_ws(),length(),trim(),ltrim(),rtrim(),replace(),format()

数值运算函数

ceil()向上取整

div 整数除法

floor ()向下取整

mod取模

power() 幂运算

round()四舍五入

truncate()数字截取

比较函数:

[not] between...and... 【不】范围之内

[not]in() 【不】在列出值范围内

is [not] null 【不】为空

日期时间函数:

now() 当前的日期和时间

curdate() 当前日期

curtime() 当前时间

date_add() 日期的加减

datediff() 日期差值

date_format() 日期格式化

信息函数

connection_id() 连接id

datebase() 当前数据库

last_insert_id() 最后插入的id号

user() 当前用户

version() 版本信息

聚合函数:

avg() 平均值

count()  计数

max() 最大值

min() 最小值

sun()求和

加密函数:

MD5() 信息摘要算法

password() 密码算法

原创粉丝点击