I wanted to know how to use two max function in a query, i have this query

```
SELECT g.studentid, g.blockcode, sb.subjectcode, sb.daystart, sb.dayend, sb.stime, sb.sday, ii.firstname instructorname,  ii.lastname instructorlastname, sb.roomcode, r.building, d.description, rr.studentid,rr.sem, rr.sy
            FROM grades g 

            JOIN subjectblocking sb ON g.blockcode=sb.blockcode
            JOIN instructorinfo ii ON sb.instructorid=ii.instructorid
            JOIN subjects d ON sb.subjectcode = d.subjectcode
            JOIN room r ON sb.roomcode=r.roomcode
            JOIN register rr ON rr.studentid=g.studentid
            WHERE g.studentid='2011-S1308'
            AND rr.sem=(SELECT max(sem) from register
            WHERE sy= (SELECT max(sy) from register))
            ORDER BY  sb.daystart ASC, sb.stime like '%AM%' DESC;

```

the reason why I used two max because I want both semester and school year on max, so that student can view their schedule on what is current.How should i max them at the same time? Also, the problem in my query is that only 1 max works, the max(sem). Thank you in advance!