SQL语句如下;
select 'a887',area,count(*) from venture.userinfo where (yhlb='CA' or yhlb='CE') and logintype<>'KH121' and to_char(logdt,'YYYYMMDD') between '19900101' and '20050327' group by area
union
select 'b112',area,count(*) from venture.userinfo where yhlb='KG' and logintype<>'KH120' and to_char(logdt,'YYYYMMDD') between '19900101' and '20050327' group by area
union
select 'c174',area,count(*) from venture.userinfo where yhlb='DG' and logintype<>'KH113' and to_char(logdt,'YYYYMMDD') between '19900101' and '20050327' group by area
union
select 'd027',area,count(*) from venture.userinfo where (yhlb='XH' or yhlb='XE') and logintype<>'KH119' and to_char(logdt,'YYYYMMDD') between '19900101' and '20050327' group by area
union
select 'e034',area,count(*) from venture.userinfo where yhlb='ZH' and logintype<>'KH120' and to_char(logdt,'YYYYMMDD') between '19900101' and '20050327' group by area
union
select 'f103',area,count(*) from venture.userinfo where yhlb='KG' and yhlb2='LYH' and logintype<>'KH120' and to_char(logdt,'YYYYMMDD') between '19900101' and '20050327' group by area
union
select 'g010',area,count(*) from venture.userinfo where yhlb='XM' and yhlb2='LYH' and logintype<>'KH119' and to_char(logdt,'YYYYMMDD') between '19900101' and '20050327' group by area;
[
]