'Select rows with multiple max condition

Table details are contract (Studentid, Term, Contract ID, Sequence No, Qualification) For every studentid there are multiple contracts drawn up in different terms in a sequential order

I am looking at a sql that will help me capture all rows for distinct students that are latest term and max sequence



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source