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
可以作爲查詢條件