Code
SELECT h.id_chamado,t.dsc_nome,s.dsc_status,sum(trunc(h.dat_fechamento - h.dat_abertura))
|| ' DIAS ' ||
floor(((h.dat_fechamento-h.dat_abertura)*24*60*60)/3600)
|| ' HORAS ' ||
floor((((h.dat_fechamento-h.dat_abertura)*24*60*60) -
floor(((h.dat_fechamento-h.dat_abertura)*24*60*60)/3600)*3600)/60)
|| ' MINUTOS ' ||
round((((h.dat_fechamento-h.dat_abertura)*24*60*60) -
floor(((h.dat_fechamento-h.dat_abertura)*24*60*60)/3600)*3600 -
(floor((((h.dat_fechamento-h.dat_abertura)*24*60*60) -
floor(((h.dat_fechamento-h.dat_abertura)*24*60*60)/3600)*3600)/60)*60) ))
|| ' SEGUNDOS ' tempo_atividade
FROM sgc.hchamados h,tecnicos t,status s
where h.cod_tecnico = t.cod_tecnico
and h.cod_status = s.cod_status
--and h.id_chamado = 42
group by grouping sets(h.id_chamado),s.dsc_status,t.dsc_nome,h.dat_fechamento,h.dat_abertura;