Hi. Im not expert in SQL and i work on a query that return separable lines, but i want sum all records.
This is my query
select (CASE
WHEN d.cd_procedimento = 40901394 THEN (select count(*)+3 from DUAL )
ELSE (select count(*) from dual)
END) AS qt_laudo
from laudo_paciente a,
prescr_procedimento b,
atendimento_paciente_v c,
procedimento d
where a.nr_prescricao = b.nr_prescricao
and a.nr_seq_prescricao = b.nr_sequencia
and a.nr_atendimento = c.nr_atendimento
and b.cd_procedimento = d.cd_procedimento
and b.ie_origem_proced = d.ie_origem_proced
and a.nr_prescricao in (3496038, 3509479)
GROUP BY a.nr_sequencia,d.CD_PROCEDIMENTO
My query return:
QT_LAUDO
1
4
1
1
1
1
1
I would like that return like that:
QT_LAUDO
10