用联合Unionselect count(*) from a where col='xxx' union
select count(*) from b where col='xxx' union
select count(*) from c where col='xxx' union
select count(*) from d where col='xxx'
select count(*) from b where col='xxx' union
select count(*) from c where col='xxx' union
select count(*) from d where col='xxx'
把条件的or 改为几个union 如楼上.
为什么"不推荐用left join on 用 (+)"?
可能我没说清楚,我是主要是想问"此时还是无法选出,发现当作外连接时如果连接的表为空时,on 1=1 的条件无法构成我们想要的结果集,而当作外连接时如果连接的表不为空时,on 1=1的条件是可以使用的".
谢谢!