Many thanks! Ismo's reply solved the problem, and Tom's reply solved another one. Marko Ismo Tuononen wrote:
select studentid,max(score) from studentprofile group by studentid;
On 20/02/07, Tom Lane <tgl@xxxxxxxxxxxxx> wrote:
The optimal index for this would be on studentprofile(studentid,score).