zoukankan      html  css  js  c++  java
  • SQL中JOIN的使用

    根据网络上的一些材料整理得到:

    左连接 (left join)
    select * from table1 left join tbale2 on table1.id=table2.id
    这条sql语句返回结果 table1表中的数据全部返回 table2表中的数据只返回满足where条件的

    右链接 (right join)
    select * from table1 right join table2 on table1.id=table2.id
    这条sql语句返回结果 table2表中的数据全部返回 table1表中的数据只返回满足where条件的

    (insert join)
    select * from table1 inner join table2 on table1.id = table2.id
    这条sql语句返回结果 显示满足条件的数据 并不以谁为主表

    ---------------------------------------------------------------------------------------后续继续补充-------------------------------------------------------------------------

  • 相关阅读:
    校验参考相关备份
    API接口设计
    redis 基础配置
    Apollo 统一配置中心
    http返回状态码记录
    ngnix实战
    OAuth2三方授权
    OAuth2授权协议记录
    KMP算法
    分治法
  • 原文地址:https://www.cnblogs.com/dingcx/p/8472307.html
Copyright © 2011-2022 走看看