用联合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'

解决方案 »

  1.   

    不推荐用left join on 用 (+)
    把条件的or 改为几个union 如楼上.
      

  2.   

    先谢谢 freddy2003().
    为什么"不推荐用left join on 用 (+)"?
    可能我没说清楚,我是主要是想问"此时还是无法选出,发现当作外连接时如果连接的表为空时,on 1=1 的条件无法构成我们想要的结果集,而当作外连接时如果连接的表不为空时,on 1=1的条件是可以使用的".
    谢谢!
      

  3.   

    用left join on 跟本不能得到你所要的结果,如果a表为空的话,就一条记录也没有