s**********o 发帖数: 14359 | 1 这两个有差异吗,看到有PROGRAMMER写了第一段,想改成第二段,就说不出为什么
Q1:
select
t1.*, t2.detail
from
table1 t1
left join
table2 t2 on t2.orderNo = t1.orderNo
Q2:
select
t1.*, t2.detail
from
table1 t1
left join
table2 t2 on t1.orderNo = t2.orderNo | d*******n 发帖数: 109 | | c*****d 发帖数: 6045 | 3 t2.orderNo = t1.orderNo t1.orderNo = t2.orderNo
我认为没有语法上的区别,返回结果相同,效率也相同
这个语句我的理解就是
if [ t2.orderNo == t1.orderNo ] ; then t1 left join t2; fi
效果和语句
if [ t1.orderNo == t2.orderNo ] ; then t1 left join t2; fi
相同 |
|