I have a table like this:
date(timestamp) Error(integer) someOtherColumns
I have a query to select all the rows for specific date:
SELECT * from table
WHERE date::date = '2010-01-17'
Now I need to count all rows which Error is equal to 0(from that day) and divide it by count of all rows(from that day).
So result should look like this
Date(timestamp) Percentage of failure
2010-01-17 0.30
Database is pretty big, millions of rows..
And it would be great if someone know how to do this for more days - interval from one day to another.
Date(timestamp) Percentage of failure
2010-01-17 0.30
2010-01-18 0.71
and so on