I have a database table called 'dbTable' with 7 columns which are : name, score1, score2, score3, score4, score5, 2nd_lowest. Each student has a record with all score columns filled.
eg//
If james had 'score1' = 40, 'score2' = 70, 'score3' = 36, 'score4' = 60, 'score5' = 50.
How do I write an sql query to select 40 as the second smallest score value and update it into 2nd lowest column.
so that the remaining records can fill '2nd_lowest' as below:
| name | score1 | score2 |score3 | score4 |score5 | 2nd_lowest |
-------------------------------------------------------------------------------------
| jimy | 40.0 | 70.0 | 36.0 | 60.0 | 50.0 | 40.0 |
| kane | 20.0 | 90.0 | 72.0 | 10.0 | 30.0 | 20.0 |
| mimy | 50.0 | 80.0 | 76.0 | 30.0 | 50.0 | 50.0 |
am using an sqlite3 dbms
all help will be well appreciated. thank you