For a table called test_section there are columns topic, section_type, result, test_id (FK).
test_id is the primary key of a table called test, which also has a column called student_id and test_date.
For a given student_id, I want to find every combination of topic and section_type and the result for that combination. When multiple instances of a combionation exist for that student, I want to return the result with a test_id corresponding to the earliest test_date (the initial result).
It can be assumed that each test_id will have a unique test_date and that a test_id will not be linked to more than one instance of any combination of topic and section_type.
What sort of query should I use here? As of now, I can only think of using multiple subqueries, but I ideally want the most efficient approach.