Any clever SQL people out there? Given the raw data on the left, (a table of test results) how do I write a SQL query to give me the results on the right, (the results grouped by date as well as grouped by result)?
4
1
3
That was fast, we have a winner! SELECT `date`, SUM(IF(success, 1, 0)) AS `success`, SUM(IF(success, 0, 1)) AS `fail` FROM `results` GROUP BY `date`
Replying to @aaronpk
something like this or similar (untested)?: SELECT `date`, SUM(IF(success, 1, 0)) AS `success`, SUM(IF(success, 0, 1)) AS `fail` FROM t GROUP BY `date`
3
6
Who needs StackOverflow when you have Twitter?
1
Replying to @MeetGuillermo
my problem was I couldn't even figure out how to ask this with words so I wasn't sure what to search for!

Sep 16, 2022 · 4:24 PM UTC