select sum(aa) as 总记录数 from(
select aa=count(*) from 表1 where name='aa'
union all
select aa=count(*) from 表2 where name='aa'
....
)a
select aa=count(*) from 表1 where name='aa'
union all
select aa=count(*) from 表2 where name='aa'
....
)a
select name from a
union all
select name from b
union all
select name from c
) as a
where name = 'aa'
第二楼的方法,在NAME为空时就不通用了,会出错
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
//第二楼的方法,在NAME为空时就不通用了,会出错
无语...