1.截取函数
select substr(carid,7,8) as carid from users;carid:要截取的字段名
7:开始位置
8:结束位置
2.替换函数
select
replace(deptno,'01',‘呵呵’) as deptno from users;
deptno:字段
01:值
呵呵:替换值
3.取余函数
select
mod(age,10) as age from users;
age:字段age的值,与10取余。
4.提取函数
select
extract(year from regdate) from users;
提取日期字段值得年份
select
* from users where extract (month from regdate ) = 5
可以作为查询条件