Hi there,
If we have a student score table with the names of 5 students and their
marks in two exams:
+--------+-------+-------+
| Name | Mark1 | Mark2 |
+--------+-------+-------+
| John | 10 | 8 |
| George | 7 | 2 |
| Paul | 3 | 6 |
| Nick | 9 | 6 |
| Adam | 4 | 8 |
+--------+-------+-------+
I want to order the entries, according to the WORST of the two marks of
each of the students. IE:
+--------+-------+-------+------------+
| Name | Mark1 | Mark2 | Worst Mark |
+--------+-------+-------+------------+
| John | 10 | 8 | 8 |
| Nick | 9 | 6 | 6 |
| Adam | 4 | 8 | 4 |
| Paul | 3 | 6 | 3 |
| George | 7 | 2 | 2 |
+--------+-------+-------+------------+
Of course, I do not really want the "Worst Mark" column (that is just
to show you, on what criteria I want the sorting).
I would be indebted if you could suggest any SQL command for this
advanced sorting.
Thanks in advance.
Asteras
If we have a student score table with the names of 5 students and their
marks in two exams:
+--------+-------+-------+
| Name | Mark1 | Mark2 |
+--------+-------+-------+
| John | 10 | 8 |
| George | 7 | 2 |
| Paul | 3 | 6 |
| Nick | 9 | 6 |
| Adam | 4 | 8 |
+--------+-------+-------+
I want to order the entries, according to the WORST of the two marks of
each of the students. IE:
+--------+-------+-------+------------+
| Name | Mark1 | Mark2 | Worst Mark |
+--------+-------+-------+------------+
| John | 10 | 8 | 8 |
| Nick | 9 | 6 | 6 |
| Adam | 4 | 8 | 4 |
| Paul | 3 | 6 | 3 |
| George | 7 | 2 | 2 |
+--------+-------+-------+------------+
Of course, I do not really want the "Worst Mark" column (that is just
to show you, on what criteria I want the sorting).
I would be indebted if you could suggest any SQL command for this
advanced sorting.
Thanks in advance.
Asteras
Comment