// 为空补零
ifnull(character,0)
//选择
CASE character
WHEN 1 THEN ‘Value1’
WHEN 2 THEN ‘Value2’
WHEN 3 THEN ‘Value3’
ELSE ' Value’4'
END
//拼接一列
select '1月' as month union select '2月' union select '3月' union select '4月' union select '5月' union select '6月'
union select '7月' union select '8月' union select '9月' union select '10月' union select '11月' union select '12月'
//时间更改格式
date_format(character,'%Y-%m')
//字符串拼接
concat(‘value1’,’value2’)
//字符串截取
substring(character,开始截取,截取长度)
//取最小
Min(character)
//取最大
Max(character)
//取平均
Avg(character)
//保留小数点几位
round(character,位数)
//取某几列最大值 值为空不比较直接为null
greatest(character1, character2, character3,character4)
//取某几列最小值 值为空不比较直接为null
least(character1, character2, character3,character4)