条件查找 where 字段=值 多条件 and or
-- select * from tb_1 where name="打算"
-- 条件查询 where 字段=值 多字段 and or
-- select * from tb_1 where name="打算" or sex="女"
-- 查询可以使用多种运算符
-- select * from tb_1 where age>50
-- select * from tb_1 where date>="2024-4-5" and date<="2024-4-25" and sex="女"
-- 范围查找 in
-- select * from tb_1 where name in ("打算","撒旦")
-- 去重查询 distinct
-- select distinct sex from tb_1
-- 模糊查询 like 结合 占位符 %(任意字符) _(一个字符)
-- select * from tb_1 where name like "打_"
-- select * from tb_1 where name like "%阿%"
-- select * from tb_1 where age like "%3%"
-- 排序查询 order by 字段 asc(升序) | desc(降序) 多字段排序用逗号隔开
-- select * from tb_1 order by age desc,id desc
-- 深度查询 limit 数值(开始位置) , 数值(数量)
-- select * from tb_1 limit 0,3
-- 一页显示两条 第一页数据
-- select * from tb_1 limit 0,2;
-- 一页显示两条 第二页数据
-- select * from tb_1 limit 2,4;
-- 聚合查询 提供聚合函数 count(字段) 数量 avg() 平均值 sum() 求和 max()求最大 min()求最小
-- select count(name) from tb_1
-- select sum(id)/min(age) from tb_1
-- 分组查询 group by 字段 having 分组后的条件
-- select sex,count(*) as 数量,max(age) from tb_1 group by sex