getting single records

  • Here's the problem:

    I have a table containing student, grades and testNotes. It's set up so one student could have multiple records, one for each test. How would I call a recordset containing one record including all fields for each student based on their highest grade?

  • select *

    from tbl t1

    where grade = (select max(t2.grade) from tbl t2 where t1.student = t2.student)

    If it is possible to have multiple recs for a student with the same highest grade you will have to say which record oyu wish to select - latest maybe?

    Cursors never.

    DTS - only when needed and never to control.


    Cursors never.
    DTS - only when needed and never to control.

  • This only return one record. Is there a way to get a record for each student with one query?

    Also, there's only one table involved in the query.

    Thanks

    Blue

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply