I have a query where I am trying to find the count of values for 2 parameters. Let's say for this example that I have a set of people, I record the eye colour and hair colour for each person.
So I now want to see a distribution of how many people exist for each set of eye colour and hair colours. Simple I can run
select eye, hair, count(*) from people
group by eye, hair
But this returns a table with two columns. What I would like is to see is a matrix format where the first column shows the eye colour, then each next column represents an hair colour and the value is the count of individuals with the hair and eye colour.
Is there a way to do this?