Say my table has only 2 fields: Idand color.
id color
----------
1 Green
2 Red
3 Yellow
I want the graph to appear in a row not in a column.
SELECT COUNT(color), color
FROM MYTABLE
GROUP BY color
This gives me:
count color
--------------
10 Green
20 Red
15 Yellow
I need it to display as:
Green Red Yellow
-------------------
10 20 15
source
share