Hey all,
I've got a table with the following columns:
DATE EVENT COUNT FAIL
it basically keeps a track of how many times an even occurs/fails on a day, and there can be multiple events (A, B, C).
1-july A 20 34
1-july B 27 46
1-july C 26 23
2-july A 24 09
2-july B 22 19
3-july C 21 10
I wanted to write a query to give me the total sum of COUNT and FAIL for EVEN A for july-1 to july-3, I cant seem to figure out how to get MySQL to do this.
I know we can get all of the rows for event A with something like:
SELECT COUNT, FAIL from tbl WHERE DATE BETWEEN start AND end
but how can we get MySQL to group together all the columns with the same EVENT field and sum up their COUNT and FAIL columns?
Is this even possible with a single query? Any help is appreciated.
Thanks!