I have two tables STUDENTS and REGISTRATIONS. I wish to update my
STUDENT table field, LAST_ATTENDED_SESSION_ID from my REGISTRATION
table of the max SESSION_ID found in the REGISTRATION table.
STUDENT starts off with:
STUDENT_ID LAST_ATTENDED_SESSION_ID
123456789 000000
234567890 000000
345678901 000000
REGISTRATIONS:
STUDENT_ID SESSION_ID CLASS_ID
123456789 200001 BUS100
123456789 200102 BUS150
123456789 200203 BUS160
I want to update my STUDENT.LAST_ATTENDED_SESSION_ID with the
MAX(SESSION_ID) found in REGISTRATIONS for each student.
I'd end up with:
STUDENT_ID LAST_ATTENDED_SESSION_ID
123456789 200203
234567890 000000
345678901 000000
I've found examples here about selects and sub-queries, but nothing
yet in my situation with an update.
TIA
Rob