select count(*)
 from (
         select a from t_a where
         union 
          select a from t_b where
       )t