(+) syntax for outer joins in mysql [duplicate]

时光总嘲笑我的痴心妄想 提交于 2019-12-10 13:09:52

问题


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

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.

In oracle I could do this

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?


回答1:


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.



来源:https://stackoverflow.com/questions/6658334/syntax-for-outer-joins-in-mysql

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!