How to pivot a table in MySQL,
PIvoting table around date column in Mysql
I have a mysql data table as follows
**Student_id Student_name Subject Activity Marks**
1 Raja Maths null 44
1 Raja IT practical 33
1 Raja Tamil null 22
1 Raja Histry null 54
2 Ganga Maths null 33
2 Ganga IT null 22
2 Ganga Histry null 44
2 Ganga Tamil null 89
So i need to pivot my table as below,
Student_id Student_name Mths IT Tamil Histry Activity
1 Raja 44 33 22 54 practical
2 Ganga 33 22 89 44 null
I tried to many ways by using the stackoverflow, but i couldnot able to achieve the target, need a help from the mysql expert,