• oracle表连接


    create table a(
    aid number,
    aname varchar2(20)
    );
    create table b(
    bid number,
    bname varchar2(20)
    );

    create table c(
    cid number,
    cname varchar2(20)
    );

    insert into a(aid,aname)

    SELECT 1,'a1' FROM dual
    union all
    SELECT 2,'a2' FROM dual;

    insert into b
    SELECT 1,'b1' FROM dual;

    insert into c
    SELECT 2,'c2' FROM dual
    union all
    SELECT 1,'c1' FROM dual;

    commit;

    1、SELECT * FROM a left join b on a.aid=b.bid left join c on c.cid= a.aid;

    结果:

    2、SELECT * FROM a left join b on a.aid=b.bid left join c on c.cid= b.bid;

    3、SELECT * FROM a left join b on a.aid=b.bid right join c on c.cid= b.bid;

    4、SELECT * FROM a inner join b on a.aid=b.bid right join c on c.cid= b.bid;

    5、SELECT * FROM a inner join b on a.aid=b.bid left join c on c.cid= b.bid;

    6、SELECT * FROM a cross join c

  • 相关阅读:
    下拉框插件开发 (一)
    工厂模式 抽象工厂模式
    闭包 构建函数 简单工厂模式
    js继承
    浅谈js观察者模式
    浅谈js单例模式
    localstorage本地存储
    Vi 配置文件
    Vi Command
    我的Firs博客
  • 原文地址:https://www.cnblogs.com/hm1990hpu/p/8854373.html
Copyright © 2020-2023  润新知