日期:2014-05-17  浏览次数:20681 次

突然对多表查询有点疑惑
select xx…… from a,b where xx=xx
select xx…… from a join b on xx=xx
今天做一个项目,突然发现这两句的结果是一样的,请问这两种查询方式有什么区别

------解决方案--------------------
第一个是内连接,第二个是左外连接。两者查询的数据结果是一样的,说明两者的关联条件的数值是一样的,是数据的一致造成了结果一样。
------解决方案--------------------
两个没区别

内连接
select xx…… from a,b where xx=xx
select xx…… from a join b on xx=xx

左连接
select xx…… from a,b where a.xx=b.xx(+)
select xx…… from a left join b on a.xx=b.xx

右连接
select xx…… from a,b where a.xx(+)=b.xx
select xx…… from a right join b on a.xx=b.xx
------解决方案--------------------
没有区别
------解决方案--------------------
一个是89年的sql标准,一个是92年的sql标准,实际没什么区别