oracle mysql 中外连接的 (+) 语法

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/6658334/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 00:08:31  来源:igfitidea点击:

(+) syntax for outer joins in mysql

mysqlsqloracleouter-join

提问by benstpierre

Possible Duplicates:
Oracle “(+)” Operator
Oracle (Old?) Joins - A tool/script for conversion?

可能的重复项:
Oracle“(+)”运算符
Oracle(旧?)联接 - 用于转换的工具/脚本?

I have been somewhat spoiled by using Oracle for years. Now I am using mysql and cannot find a non-ansi version/shorthand version of outer joins in MySQL.

多年来,我一直被 Oracle 宠坏了。现在我正在使用 mysql 并且在 MySQL 中找不到非 ansi 版本/速记版本的外连接。

In oracle I could do this

在 oracle 我可以做到这一点

select a.country acountry,
        a.stateProvince aStateProvince,
        b.countryName bcountry,
        b.name bstateProvince
  from User a,
          stateprovince b
  where a.country*=b.countryName **(+)**
          and a.stateProvince*=b.name **(+)**

to get an outer join. Can mysql do something similar?

获得外连接。mysql 可以做类似的事情吗?

回答by ypercube??

Simpler than this:

比这更简单:

select a.country acountry,
        a.stateProvince aStateProvince,
        b.countryName bcountry,
        b.name bstateProvince
  from User a
        left join
          stateprovince b
    on  a.country = b.countryName 
          and a.stateProvince = b.name 

No.

不。