sql语句的顺序
select
from
where
group by
having
order by
limit
常规函数
RTrim
LTrim
Left
Right
Length
Locate
Lower
Upper
SubString
Soundex
select name from user where Soundex(name) = Soundex('Y lie');
//有条记录name = Y lee 发音相似就会被检索出来 不知道对中文拼音如何 呵呵
日期函数
AddDate
ADDTime
CurDate
CurTime
DateDiff
Date_Add
Date_Format
Day
DayOfWeek
Hour
Minute
Month
Now
Second
Time
Year
数值处理
Abs
Cos
Exp
Mod
Pi
Rand
Sin
Sqrt
Tan
聚合函数
AVG
select avg(distinct price) as avg from products;
//思考 distinct 同样可以作用其他聚合函数 如 count 必须指定列名,sum和min也可以 不过没实际无意义
COUNT
select count(*) from tableName; //不忽略Null值计数
select count(filedName) from tableName; //忽略Null值计数
MAX
MIN
SUM