ben*_*rre 6 mysql sql oracle outer-join
多年来我一直在使用Oracle.现在我使用mysql并且在MySQL中找不到外连接的非ansi版本/速记版本.
在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 **(+)**
Run Code Online (Sandbox Code Playgroud)
获得外部联接.mysql可以做类似的事吗?
比这更简单:
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
Run Code Online (Sandbox Code Playgroud)
不。
| 归档时间: |
|
| 查看次数: |
12261 次 |
| 最近记录: |