If i have this data:
SELECT *
FROM
(
SELECT 'BIO' PROGRAM, 1 TIME_PERIOD FROM DUAL
UNION
SELECT 'BIO' PROGRAM, 2 TIME_PERIOD FROM DUAL
UNION
SELECT 'MATH' PROGRAM, 3 TIME_PERIOD FROM DUAL
UNION
SELECT 'MATH' PROGRAM, 4 TIME_PERIOD FROM DUAL
UNION
SELECT 'MATH' PROGRAM, 5 TIME_PERIOD FROM DUAL
) t1
How would I find the first TIME_PERIOD value that represents the final PROGRAM?
The answer will be TIME_PERIOD = 3.
But how do I get this result with an analytical function?
Think of this data as a student who has BIOLOGY as their first major in their first term.
But they change majors to MATH in the 3rd term and do not do any subsequent change in their major.