我有一个查询,它是Postgres中多行的总和
查询------------------------------------------------------------------
select
...
sum(i.cantidad) as totalHoras,
sum(i.minutos) as totalMinutos,
...
结果-------------------------------------------------------------------
totalHoras | toltaMinutos
152 | 450
160 | 0
163 | 90
I could in the same statement, divide the minutes by 60 and add them at the same time to the hours, and put them in a new column called "total"
152 + (450/60) = 159,5
160 + (0/60) = 160 <-- If the minutes are 0, check that it does not divide
163 + (90/60) = 164,5
I use postgres version 12