I have this table which shows the number of 200 and 404 responses from a website for each day. I need to rearrange it so each date is displayed once per row, and the status codes become the columns.
status | date | num
---------------+------------------------+-------
200 OK | 2016-07-31 00:00:00+00 | 45516
404 NOT FOUND | 2016-07-31 00:00:00+00 | 329
200 OK | 2016-07-30 00:00:00+00 | 54676
404 NOT FOUND | 2016-07-30 00:00:00+00 | 397
200 OK | 2016-07-29 00:00:00+00 | 54569
404 NOT FOUND | 2016-07-29 00:00:00+00 | 382
200 OK | 2016-07-28 00:00:00+00 | 54404
404 NOT FOUND | 2016-07-28 00:00:00+00 | 393
What I'm ultimately trying to find out is the percentage of responses which are 404 on each day. Something like select (date.200 / date.404) from mytable
