|
I have two tables, a class schedule for the grade exam, examsubject
Since the score table contains the scores of all courses, some grades have this course, some do not, so when querying the results, I made a second table
examlistid course ClassID
1 Language 1
2 Mathematics 1
3 English 1
4 Physics 2
5 Chemistry 2
There is also a transcript of the whole school: [20161230]
Student ID Chinese Mathematics English Physics Chemistry Biology Geography Politics History
111 50 50 50 NULL NULL 60 60 60 60
112 50 50 50 NULL NULL 65 65 65 65
I want to get the course name through the ClassID value of the examsubject table, and then generate a grade query,
Generate the following style: ClassID=1, the score is the value in [20161230]
Student ID Chinese Mathematics English
111 50 5 50
112 50 50 50
When ClassID=2
The generated grade table style is:
Student ID Physical Chemistry
xx xx xx
xx xx xx |
|