MySQL数据库知识

1.在编程中,数据库的内容非常重要。

2.**语句的执行顺序:**
  select from where group by having order by--是这个顺序吗?不是。
  MySQL执行语句的顺序是:from where select group by having order by

3.order by 
排序,默认升序asc 降序desc

4.group by 分组查询
--注意:按分组条件分组后,每一组只会显示第一条内容。

5.where和having区别
--这俩货都可以用来过滤或者说筛选,其中where是在group by之前用,having是在group by之后用。
--having可以之前替换where使用,但是前提是不能有group by

6.多表查询
      内连接:inner join
      外连接:left join    right join
      全连接:full join(不支持,不用考虑这个)

7.复合查询和子查询(把查询语句作为另一个查询的表)
posted @ 2024-09-22 16:44  疯狂Python  阅读(12)  评论(0)    收藏  举报