left join on、where后面的条件的区别
left join on、where后面的条件的区别
left join on 即左连接,把left join左边的表的记录全部找出来。
select a.* from a left join b on a.id=b.id where b.end_date=to_date('99991231','yyyymmdd')
写在不同的位置,得到的结果可能会不同,这一点要注意。
两个表
转载
2012-05-10 15:16:06 ·
659 阅读 ·
0 评论