-1

Student Table

enter image description here

History Table

enter image description here

I want to display like this

id Name title1 total1 get1 year1 title2 total2 year2 title3 total3    get3 year3 
1 Usman Hayat Matric 850 600 2001 Inter 1100 900 2003 NULL NULL NULL NULL 
2 Hamid Khan  Matric 850 500 2002 Inter 1100 789 2004    BA 800 400 2006
Nana Partykar
  • 10,556
  • 10
  • 48
  • 77
sikander
  • 11
  • 2

1 Answers1

0

You need to use pivot for getting the requested result you can see further details on pivot here

MySQL pivot table

Go thorough this if still not able to write the query comment below will write query.

Community
  • 1
  • 1
smali
  • 4,687
  • 7
  • 38
  • 60