zoukankan      html  css  js  c++  java
  • Oracle外连接、内连接


    ====================
    内连接
    ====================
    内链接实际上就是利用where子句对两张表形成的笛卡儿积 进行筛选

    ====================
    外连接
    ====================

    ===============================
    左外连接 left join .. on ..
    ===============================
    左侧的表完全显示
    select stu.name,stu.id,exam.grade from stu [left join] exam [on] stu.id=exam.id;
    或者
    select stu.name,stu.id,exam.grade from stu, exam stu.id=exam.id(+);

    ===============================
    右外连接 right join .. on ..
    ===============================
    右侧的表完全显示
    select stu.name,stu.id,exam.grade from stu [right join] exam [on] stu.id=exam.id;
    或者
    select stu.name,stu.id,exam.grade from stu, exam stu.id(+)=exam.id;

    ===============================
    完全外连接 full outer join ..on..
    ===============================
    完全显示两个表,没有匹配的记录置为空
    select stu.name,stu.id,exam.grade from stu [full outer join] exam [on] stu.id=exam.id;

  • 相关阅读:
    第三次上机
    第5次作业
    第二次上机练习
    第三次作业
    第一次作业
    第一次作业
    第二次上机练习
    第二次作业
    第一次作业
    第四周作业
  • 原文地址:https://www.cnblogs.com/qintangtao/p/2746647.html
Copyright © 2011-2022 走看看