I have a database with categories which include system and status. I can run the following to get a breakdown for either category :
SELECT status, count(*) FROM table GROUP BY status;
and the same for system.
What I need is a single query to show me how the count is distributed over both categories
So my result should have columns for each system, rows for each status and then a count in each field.
eg.
SOMESYSTEM ANOTHERSYSTEM
INERROR 5 6
OK 2 1
If anyone better at SQL than me could point me in the right direction, with some key words I can read up on, so I can crack this I'd be really grateful.