Mysql常用函数
select ABS(-8)
select celling(9.4)
select floor(9.4)
select rand()
select char_length('一二三')
select concat('我','like','编程')
select lower('ZHANGsan')
select upper('ZHANGsan')
select current_date()
select curdate()
select now()
select year(now())
select month(now())
select day(now())
select hour(now())
聚合函数
select count(`字段`) from 表名
select count(*) from 表名
select count(1) from 表名
select sun(`score`) from 表名
select avg(`score`) from 表名
select max(`score`) from 表名
select min(`score`) from 表名
- group by 字段名 – 分组
- having 条件 – 过滤分组后的信息 和where一样的,只是位置不同
扩展: MD5
update 表名 set pwd=MD5(pwd) where id=1
insert into 表名 values(4,'小明',MD5('123456'))