I have data in Mysql in this format :
name sub
----------------
a maths
a science
a history
b maths
b science
a computer
a english
c computer
c history
b history
c maths
I am planning to display this data in this format in HTML:
Name maths science history computer english
a y y y y y
b y y y n n
c y n y y n
How to formulate my sql query other than pivot table method?