数据库-Oracle-左外连接left join form on-on后条件无反应问题

下面的链接是举例说明

https://www.cnblogs.com/guixiaoming/p/6516261.html

原因:

由于A left join B on,on后的条件只起到连接表A和B的作用,不对数据进行筛选。

想添加其他非两表之间的关联条件,在left on后加where即可。

如:

select * from a
left join b
on a.id = b.id
where a.name ='...'

猜你喜欢

转载自blog.csdn.net/qq_29039853/article/details/85112202