I have a database that looks something like this:
Year Month New Visitor?
2011 Jan Yes
2011 Jan No
2012 Feb No
2012 Feb No
2012 Feb Maybe
I’d like Yes’s and No’s to be separate columns, per month so I can print it as a chart.I understand that to do this I’ll need a result like this:
Year Month Yes No Maybe
2011 Jan 1 1 0
2012 Feb 0 2 1
How might I go about this using only MySQL?
Try: