Posts by ramoncs11 • 43 points
2 posts
-
2
votes2
answers135
viewsA: How do I sum up the 2-interval difference in Postgresql?
I managed to solve the problem. Basically, the conditions go within the sum(). CREATE OR REPLACE FUNCTION total_paused_time (v_id Integer) RETURNS Interval as $$ select sum( case when end_date =…
-
2
votes2
answers135
viewsQ: How do I sum up the 2-interval difference in Postgresql?
I need to sum up all the gap differences that meet the Where condition. There is only one however, if there is no end_date on this line, I need to take the current time and do the calculation with…