Skip to main content
1 of 5

I might not understand the problem, but:

SELECT my_sum, my_sum, my_sum
FROM (
    SELECT SUM(t.customers) + SUM (t.employees)
    FILTER (
        WHERE id = 1
        AND date 
        BETWEEN %(start)s AND %(stop)s
    )  as my_sum
    FROM t
) AS tt;