in the below table TABLE1
MY QUERY TO GET LATEST RECORD:-
SELECT PID,NAME,DATE_MODIFIED FROM TABLE1
QUALIFY ROW_NUMBER() OVER (PARTITON BY PID ORDER BY DATE_MODIFIED DESC)=1
To get the lastest record ,i am writing ABOVE query?SO IT WILL WORK FOR NULL VALUES FOR TO GET LASTEST VALUES.
How do you define latest for NULLs?
Your query returns the row with the latest date per PID, if all DATE_MODIFIED are NULL it returns a random row.