-1
I am trying to count a column (minutes) as it is in the query:
SELECT distinct b.nr_atendimento
,to_char(dt_prescricao,'dd/mm/yyyy hh24:mi:ss') Prescricao
,to_char(a.dt_atualizacao,'dd/mm/yyyy hh24:mi:ss') Atualizacao
,trunc( mod(mod(a.dt_atualizacao-dt_prescricao,1)*24,1)*60 ) as Minutos
FROM result_laboratorio a,
prescr_procedimento c,
prescr_medica b
WHERE Trunc( LAST_DAY( b.dt_prescricao )) = Last_Day(:MES_REF)
AND c.nr_prescricao = a.nr_prescricao(+)
AND c.nr_sequencia = a.nr_seq_prescricao(+)
AND c.nr_prescricao = b.nr_prescricao
AND b.cd_estabelecimento = '1'
AND a.dt_atualizacao IS NOT NULL
ORDER BY nr_atendimento desc
I’m already adding up the hours and taking the minutes during the service, but I need to count the total minutes.
Upshot:
serve. Request Result Minutes
1727336 21/05/2021 08:42:00 21/05/2021 09:50:21 68
1727336 21/05/2021 08:42:00 21/05/2021 09:50:30 68
Total minutos: 136
I want my query to make the sum total
I’m already adding up the hours and taking the minutes during the service, but I need to add the tatal minutes
– Paulo
Which database manager system? Which result is returning? What is the expected result?
– Clarck Maciel
Result: meet. Request Result Minutes 1727336 21/05/2021 08:42:00 21/05/2021 09:50:21 68
1727336 21/05/2021 08:42:00 21/05/2021 09:50:30 68 Total minutes:
– Paulo
Which database is using?
– Clarck Maciel
pl sql oracle Developer
– Paulo