zoukankan      html  css  js  c++  java
  • 【转】oracle怎么实现左联,右联与外联

    select a.LINEID, a.STARTID, a.ENDID, b.X, b.Y, c.X, c.Y from GS_FNORTNLN_ZY a left outer join GS_FNODE_ZY b on a.STARTID=b.POINTID left outer join GS_FNODE_ZY c on a.ENDID=c.POINTID ---------------------------     怎么实现左联,右联与外联?在9i以前可以这么写: 左联: select a.id,a.name,b.address from a,b where a.id=b.id(+) 右联: select a.id,a.name,b.address from a,b where a.id(+)=b.id 外联 SELECT a.id,a.name,b.address FROM a,b WHERE a.id = b.id(+) UNION SELECT b.id,'' name,b.address FROM b WHERE NOT EXISTS ( SELECT * FROM a WHERE a.id = b.id); 在9i以上,已经开始支持SQL99标准,所以,以上语句可以写成: 默认内部联结: select a.id,a.name,b.address,c.subject from (a inner join b on a.id=b.id) inner join c on b.name = c.name where other_clause 左联 select a.id,a.name,b.address from a left outer join b on a.id=b.id where other_clause 右联 select a.id,a.name,b.address from a right outer join b on a.id=b.id where other_clause 外联 select a.id,a.name,b.address from a full outer join b on a.id=b.id where other_clause or select a.id,a.name,b.address from a full outer join b using (id) where other_clause
  • 相关阅读:
    keepass口令管理实践
    openssl实践
    Nmap
    SSH
    Wireshark 实践
    网站设计
    python database
    python gui
    Excel数据统计与分析
    2020-2021学期20202401金丁《网络空间安全专业导论》第十三周自学总结
  • 原文地址:https://www.cnblogs.com/adodo1/p/4327997.html
Copyright © 2011-2022 走看看