select 'ORIGINAL',
sum(totalErros) as TotalRegistros,
sum(tipoErros) as TotalItens,
count(*) as TotalEmpresa
from
(
select nuSerie, sum(qtd) as totalErros, count(*) as tipoErros
from esanTesteAuditorErroInicio
where tipoValidacao = 'V'
group by nuSerie
)
union
select 'ATUAL',
sum(totalErros) as TotalRegistros,
sum(tipoErros) as TotalItens,
count(*) as TotalEmpresa
from
(
select nuSerie, sum(qtd) as totalErros, count(*) as tipoErros
from esanTesteFirebirdErro
where tipoValidacao = 'V'
group by nuSerie
)
|