Hi i have a table like
Test_id, failed, passed, na
where the data would be something like
101, 3, 2, 4
101, 2,7,8
101, 45,6,7
102, 234,5,3
102, 3,23,2
etc....
i want to idealy return the test_id and the total in each column for the for the biggest 5 (or however many) tests that failed (there is 2-3 thousand tests and the test_id is unique)
So in this case something like
101,50,15,19
102,237,28,5
If it can't be done (returning the biggest 5 values) just return all values where the failed,passsed and na values have been added up.
Im using java and JDBC ultimately with SQL so i could possible work out the highest 5 values myself in java though doing it in SQL would save the headache and time
p.S. i dont want to do anything that alters the DB consider read-access only
Test_id, failed, passed, na
where the data would be something like
101, 3, 2, 4
101, 2,7,8
101, 45,6,7
102, 234,5,3
102, 3,23,2
etc....
i want to idealy return the test_id and the total in each column for the for the biggest 5 (or however many) tests that failed (there is 2-3 thousand tests and the test_id is unique)
So in this case something like
101,50,15,19
102,237,28,5
If it can't be done (returning the biggest 5 values) just return all values where the failed,passsed and na values have been added up.
Im using java and JDBC ultimately with SQL so i could possible work out the highest 5 values myself in java though doing it in SQL would save the headache and time
p.S. i dont want to do anything that alters the DB consider read-access only