There are two list
1, student last semester grades table:
Mathematical language name
Zhang, 80, 88
Li si, 90, 92
2, the student next semester grades table:
Mathematical language name
Zhang, 95, 90
Li si, 100, 89
How to get zhang SAN full-year result table:
Time mathematical language
Last semester, 80, 88
Next semester, 95, 90
Thank you
CodePudding user response:
League tables (name, subject, time, score)CodePudding user response:
The two tables associated once found outSelect a. *, b. * from student last semester grades table a, student next semester grades table b where a. name=b. name
CodePudding user response:
Data table itself has a problem, the design should be all semester data inA table:
Name semester course grades
Zhang SAN mathematics 80 01
Zhang SAN 01 Chinese 88
Li si math 90 01
Li si Chinese 92 01
Zhang SAN 02 math 95
Zhang SAN 02 Chinese 90
Li si 02 math 100
Li si 02 Chinese 89
CodePudding user response:
Union all link two tables togetherSelect "last semester as" "time", Numbers, Chinese students from last semester grades table where students="* *"
Union all select "for" ", Numbers, Chinese from student next semester grades table where students="* *"
CodePudding user response:
Table name: name, ID, name, gender, class, can also be a separate table, setting up class with class ID) here, learn the,,,,, etc. Personal dataTranscript: name, ID, semester, discipline, score
The name on the ID do a one-to-many relationship