Lets say I have a table like this:
+------+--------+------+
|Color |Shape |Type |
+------+--------+------+
|red |square |puzzle|
|red |circle |puzzle|
|green |star |puzzle|
|green |circle |puzzle|
|blue |square |puzzle|
|blue |star |puzzle|
|blue |triangle|puzzle|
+------+--------+------+
and I wanted to get results that looked like this:
+--------+---------+-----------+
|redCount|blueCount|squareCount|
+--------+---------+-----------+
|2 |3 |2 |
+--------+---------+-----------+
how might I change the following query to actually work, or can it simply not be done in this manner?
SELECT COUNT(Color="blue") AS blueCount,
COUNT(Color="red") AS redCount,
COUNT(Shape="square") AS squareCount
FROM toys
WHERE Type = "puzzle";