select
val1.station_code, val1.fail,val2.total
from
(
select
count(guid) fail ,
station_code
from
`sqm`.`sqm_value_quality_station`
WHERE
result='PASS'
GROUP BY
station_code
)
val1
left join
(
select
count(guid) total,
station_code
from
`sqm`.`sqm_value_quality_station`
GROUP BY
station_code
)
val2
on
val1.station_code = val2.station_code


浙公网安备 33010602011771号