Hi I have two tables with following structure
Students
+------+------+------+-------+------+------+
| Col1 | Col2 | Col3 | Col4 | Col5 | Col6 |
+------+------+------+-------+------+------+
| 01 | Hari | 20 | 80 | 21 | 81 |
| 02 | Nari | 20 | 67 | 21 | 76 |
| 02 | Lari | 25 | 87 | 26 | 96 |
+------+------+------+-------+------+------+
Here COl1= ID, Col2= Name,Col3= SubjectCode, COl4= Marks in Col3, Col5= subjectCpde, Col6= Marks for Col5
And another table called subjects
+------+-----------+
| Col1 | Col2 |
+------+-----------+
| 20 | English |
| 21 | Maths |
| 25 | Chemistry |
| 26 | Physics |
+------+-----------+
Here Col1= Subject Code, COl2= Subject Name which were referenced on in student table.
Now my query should retturn the result as follows. How it is achieved?
+---------+--------+------+
| Subject | Marks | Name |
+---------+--------+------+
| English | 80 | Hari |
| Maths | 81 | Hari |
+---------+--------+------+