I am trying to build a query that will give the the sum of totals for water moved by 3 pumps each day.
All values are the total for each pump
The problem is the end result should be (pump 1 + pump 2) – pump 3. The query I’m using is:
SELECT DISTINCT(date_time), SUM(rec_value)
FROM
rec_address_change
WHERE (address_id = 7 OR address_id = 11 OR address_id = 15)
GROUP BY date_time ORDER BY date_time;
Currently this just gives the total combined of all 3 pumps for each day
1 Answer