select (select count(*) as temp from table1
             where conditions)+
         (select count(*) as temp from table2
             where conditions)+
         (select count(*) as temp from table3
             where conditions)

解决方案 »

  1.   

    select sum(temp) from 
    (
    select count(*) as temp from table1
    where conditions
    union all
    select count(*) as temp from table2
    where conditions
    union all
    select count(*) as temp from table3
    where conditions
    ...
    )AAA
      

  2.   

    select count(*)+(select count(*) as temp from table2 where conditions)+(select count(*) as temp from table3 where conditions) as temp from table1 where conditions
      

  3.   

    select sum(temp) temp from(
    select count(*) as temp from table1
    where conditions
    union all
    select count(*) as temp from table2
    where conditions
    union all
    select count(*) as temp from table3
    where conditions
    ) aa
      

  4.   

    select (select count(*)  from table1
                 where conditions)+
             (select count(*)  from table2
                 where conditions)+
             (select count(*)  from table3
                 where conditions) as temp