select sum(aa) as 总记录数 from(
select aa=count(*) from 表1 where name='aa'
union all
select aa=count(*) from 表2 where name='aa'
....
)a

解决方案 »

  1.   

    select count(*) from (
    select name from a
    union all
    select name from b
    union all
    select name from c
    ) as a
    where name = 'aa'
      

  2.   

    邹建的方法更通用
    第二楼的方法,在NAME为空时就不通用了,会出错
      

  3.   

    select count(*) from (
    select name from a where name = 'aa'
    union all
    select name from b where name = 'aa'
    union all
    select name from c where name = 'aa'
    ) as a
      

  4.   

    //邹建的方法更通用
    //第二楼的方法,在NAME为空时就不通用了,会出错
    无语...