单行函数
- 日期函数
- 字符函数
- 数字函数
- to_number: 只能把字符类型的数字转为number
select to_number('333') from dual; 正确 select to_number('a000333') from dual;错误
- 转换函数
- 其他函数
- 常规函数
聚合函数
- avg 平均值
- count 总条数
- count(*)!=count(cols)
- count(*)统计的是结果集的总条数
- count(字段名)统计的是该字段值不为null的总条数
- max 最大值
- min 最小值
- sum 总和
注意:聚集函数不能和where语句结合 不能写成where avg()>a 等 - distinct 去重
select distinct column_names from table_name where 。。。
- Group by 分组
- where是在分组之前进行筛选
- having是在分组之后进行筛选