« first day (3498 days earlier)      last day (1364 days later) » 

8:15 AM
Morgen...
 
 
7 hours later…
3:33 PM
Moin
 
 
6 hours later…
9:09 PM
Hi! i using postgre, and i would like to sum every single value from my case! but when i try i get this error: SQL Error [42803]: ERROR: aggregate function calls cannot be nested
Position: 125
this is my query:
select
sum(case
when to_char(int_datahora_entrada, 'MM') = '06' and to_char(int_datahora_saida, 'MM') = '06'
then sum(date_part('day',(age(int_datahora_saida, int_datahora_entrada))))
when int_datahora_entrada < '2020-06-01' and to_char(int_datahora_saida, 'MM') = '06'
then sum(date_part('day',(age(int_datahora_saida, '2020-06-01'))))
when to_char(int_datahora_entrada, 'MM') = '06' and int_datahora_saida > '2020-06-30'
then sum(date_part('day',(age('2020-06-30', int_datahora_entrada)))) + 1
when int_datahora_entrada < '2020-06-01' and int_datahora_saida > '2020-06-30'
any ideas?
 
 
1 hour later…
10:21 PM
Which part of the error message seems unclear to you?
Also, there's no such thing as "postgre".
 
11:17 PM
i wonder if there is an alternative for this query
 

« first day (3498 days earlier)      last day (1364 days later) »