select '总排量' as pollutantName,
SUM(w.CORRECT_EMITOUT_VALUE),
'0' AS totalEV
from D_WATER_EMITION_HOUR_DATA w
where w.sample_time between
to_date('2011-05-24 00:00:00', 'YYYY-MM-DD HH24:MI:SS') and
sysdate
and w.pollution_code = '34010000000232'
--group by w.pollution_code
union
select s.name as pollutantName,
sum(w.correct_emitout_value),
'1' as totalEV
from D_WATER_POLLUTANT_HOUR_DATA w, s_pollutant_code s
where w.sample_time between
to_date('2011-05-24 00:00:00', 'YYYY-MM-DD HH24:MI:SS') and
sysdate
and w.pollution_code = '34010000000232'
and s.code = w.pollutant_code
group by w.POLLUTANT_CODE, s.name
union
select s.name as pollutantName,
sum(g.correct_emitout_value),
'2' as totalEV
from d_gas_pollutant_hour_data g, s_pollutant_code s
where g.sample_time between
to_date('2011-05-24 00:00:00', 'YYYY-MM-DD HH24:MI:SS') and
sysdate
and g.pollution_code = '34010000000232'
and s.code = g.pollutant_code
group by g.POLLUTANT_CODE, s.name
order by totalEV