
- 17.2 模糊查询
- 语法:
- between….and….
-
范围查询 in
、or
- like
通配符 %和_
- 17.3 查询空值的运算符
- is null
18. 数据排序
- 作用:对查询出的数据进行升序或降序排列
-
语法:select col11,col2,col3…from table order by order_by_collist[asc/desc]
- 18.1 多列排序:
- 关注点:升序、降序、优先级

19. 数据分组
-
语法:select col1..col2.. from table Group by col
分组配合排序
-
注意:如果使用了group by
分组,那么select不允许出现其他列,除非这些列包含在分组中
20. 聚合函数
-
作用:对多条数据做统计功能
-
注意:在使用聚合函数后,select
后不允许出现其他列,除非这些列包含在分组中或者聚合函数中

- 20.1
常用聚合函数

- 20.2
聚合函数与Group by
语句配合使用

21. Having by
语句
-
作用:having by
为group by之后得到数据进行进一步的筛选
-
类似于select
和 where的关系。Where
为select后的数据进行进一步的筛选。
- Having by
为group by后的数据进行筛选
22. Limit
关键字的使用
- 语法:
select * from table limit m
select * from table limit m,n
23. sql
语句执行顺序
— from
表名
— where
— group by
— select distinct *
— having
— order by
— limit
24. 连接查询
- 当查询结果的数据来自多张表的时候,需要将多张表连接成一个大的数据集,再选择合适的列进行返回。

