解决方案 »

  1.   

    select dq,bz,count(*) from (
    select 'aa' as bz,* from aa
    union all
    select 'bb' as bz,* from bb
    union all
    select 'cc' as bz,* from cc
    union all
    select 'dd' as bz,* from dd
    ) a 
    group by dq,bz
      

  2.   

    select 'aa' as tname,count(*) aags from aa where dq like '上海'
    union all
    select 'bb' as tname,count(*) aags from bb where dq like '上海'
    union all
    select 'cc' as tname,count(*) aags from cc where dq like '上海'
    union all
    select 'dd' as tname,count(*) aags from dd where dq like '上海'
      

  3.   

    谢谢楼上的两位,
    select 'aa' as tname,count(*) aags from aa where dq like '上海'
    union all
    select 'bb' as tname,count(*) aags from bb where dq like '上海'
    union all
    select 'cc' as tname,count(*) aags from cc where dq like '上海'
    union all
    select 'dd' as tname,count(*) aags from dd where dq like '上海'这样问题解决了;
    谢谢·