I have searched the forum, and couldn't find an answer. So I apologize if this is out there. This seems simple in my mind, however, I can't seem to get the correct code.

I have 2 tables. `STUDENT_TERMS_VIEW` table holds `STTR_STUDENT`, `STTR_TERM` and `TERMS` table, holds the `TERM_END_DATE`. I need to find a way to select the student's last term based on `MAX(TERM_END_DATE)`, but I get `STTR_TERM` duplicate rows per student. I need to get 1 row per student and their last term attended.

EDIT: Ok so both tables are linked by `TERM`.

[View Code Here](https://i.stack.imgur.com/lq9jf.png)

As you can see, I am getting duplicate TERMS for the same student, even though I am pulling `MAX(TERM_END_DATE)`

![View SQL Image](https://i.stack.imgur.com/vjGLQ.png)