+ -
当前位置:首页 → 问答吧 → left join和right join的区别在哪里

left join和right join的区别在哪里

时间:2011-07-25

来源:互联网

mysql里面的左连接和右连接,我感觉都一样啊,比如select * from table1 left join table2 on table1.id=table2.id
如果变成右连接,直接变成select * from table2 left join table1 on table1.id=table2.id就可以了,何必要有right join呢,谢谢各位,请多多指点

作者: yifuzhiming   发布时间: 2011-07-25

当然不能完全替代,

select * from table1 right join table2 on table1.id=table2.id, table 3 WHERE table1.x = table3.x

作者: shine333   发布时间: 2011-07-25