I want to return 1 row per person based on the latest "APP_START_DT".
I want to make sure it looks at MAX(APP_START_DT) and then follows all dates on that row for that person and disregard the other rows and dates on it.
This is what I have tried:
select distinct ap1.ID,
MAX(ap1.APP_START_DT) over (PARTITION by ap1.ID) APP_START_DT,
ap1.APP_SUBMIT_DT
from table1 ap1
where ap1.ID in ('444','555');
Getting 2 rows for both of these ids.
My Table:
ID NAME Acct_CR_DT App_Ap APP_START_DT APP_SUBMIT_DT
444 ABC1 9/5/2018 My univ 9/5/2018 9/14/2018
444 ABC1 9/5/2018 {null} {null} {null}
555 ABC2 1/9/2019 {null} {null} {null}
555 ABC2 1/9/2019 Univ4 1/9/2019 1/9/2019
Desired Results:
ID NAME Acct_CR_DT App_Ap APP_START_DT APP_SUBMIT_DT App_stat
444 ABC1 9/5/2018 My univ 9/5/2018 9/14/2018 Submt
555 ABC2 1/9/2019 Univ4 1/9/2019 1/9/2019 Submt