• mysql数据库(11)--进阶一之join


    一、查看存储引擎

    show variables like '%storage_engine%';

    二、MyISAM与InnoDB的比较

     三、SQL书写顺序  vs 执行顺序

     

     四、Join连接(7种)

    • 内连接:select <select list>  from tableA inner join tableB on A.key = B.key
    • 左连接:select <select list>  from tableA left join tableB on A.key = B.key  (不满足的补NULL)
    • 右连接:select <select list>  from tableA right join tableB on A.key = B.key  (不满足的补NULL)
    • 左连接-内连接:select <select list>  from tableA left join tableB on A.key = B.key where B.key is NULL
    • 右连接-内连接:select <select list>  from tableA right join tableB on A.key = B.key where A.key is NULL
    • 全外连接= A独有+B独有+A、B共有:
      •   select <select list>  from tableA left join tableB on A.key = B.key union select <select list>  from tableA right join tableB on A.key = B.key  (union具有去重的功能)
    • 全外连接-内连接:
      •   select <select list>  from tableA left join tableB on A.key = B.key where B.key is NULL union select <select list>  from tableA right join tableB on A.key = B.key where A.key is NULL (union具有去重的功能)
  • 相关阅读:
    cdoj1325卿学姐与基本法
    HUAS 1476 不等数列(DP)
    BZOJ 1818 内部白点(离散化+树状数组)
    BZOJ 1816 扑克牌(二分)
    BZOJ 1801 中国象棋(DP)
    BZOJ 1791 岛屿(环套树+单调队列DP)
    BZOJ 1797 最小割(最小割割边唯一性判定)
    BZOJ 1789 Y形项链(思维)
    BZOJ 1787 紧急集合(LCA)
    BZOJ 1786 配对(DP)
  • 原文地址:https://www.cnblogs.com/yif930916/p/15040375.html
Copyright © 2020-2023  润新知