1. 程式人生 > >mysql 運算符和函數

mysql 運算符和函數

inter con rdate repl tween val format count cat

運算符:

算術運算符:+-*%/

比較運算符:>< >= <= = <>(!=) is(not)null between.... and (not)in like

_ 一個字符, %零個或者多個字符

邏輯運算符: AND or not

數值函數:

ceil(),floor(),round(),truncate(),mod()

字符函數:

concat(s1,s2....)

concat_ws(c,s1,s2....)

lower(s)

upper(s)

length(s)

ltrim(s)

rtrim(s)

trim(s)

substring(s,pos1,length)

left(s,n)

right(s,n)

replace(s,from,to)

format(x,n)

日期時間函數:

curdate()

curtime()

now()

sysdate()

date_add(date,interval expr type)

datediff(date1,date2)

date_format(date,format)

聚合函數:

AVG(),count(), min(),max(),sum()

mysql 運算符和函數