zoukankan      html  css  js  c++  java
  • 单表查询与多表查询复习

    复习

    1.单表查询
    	增删改查完整语法
    select distinct 字段 from 表 where group by  having  order by  limit
    比较:> < =
    区间:between and  |  in  |  not in
    逻辑: and  or  not
    相似:like  _%
    正则:regexp
    
    聚合函数:group_concat()、max()
    
    having:可以对 聚合函数 结果进行筛选,不能使用 聚合函数 别名
    order by:分组后对 聚合函数 进行排序,能使用 聚合函数 别名
    limit:条数 | 偏移,条数
    
    2.多表查询
    内连接:from emp inner join dep on emp.dep_id=dep_id 只保存两表有对应关系的记录
    左连接:from emp left join dep on emp.dep_id=dep_id   左表记录全部保存,右边没有对应记录空填充:from emp right join dep on emp.dep_id = dep.id  右表记录全部保存,左边没有对应记录空填充
    全连接:
    from emp left join dep on emp.dep_id=dep_id
    union
    from emp right join dep on emp.dep_id=dep_id
    
    
  • 相关阅读:
    android Textview动态设置大小
    小米1plus MIUI RadioButton的问题
    快读
    高精集合
    清北学堂part2
    清北学堂part1
    OTZ%%%子谦。大佬
    筛质数大优化
    回文日期
    高精度加法
  • 原文地址:https://www.cnblogs.com/aden668/p/11593804.html
Copyright © 2011-2022 走看看