I have a column called "SYS_CREAT_TS". I want the query to fetch the REV data where Status code is 2 and from the latest timestamp where status code is 2.
SELECT RVSN FROM DATA_STUS WHERE DATA_STUS_CD = 2 AND SYS_CREAT_TS IN MAX(SYS_CREAT_TS);
Some more detail
Without the latest timestamp comparison query. I'm getting Revision Number(RVSN) as 2446, 2442.
But I want the latest timestamp between these two timestamps with their respective revision numbers.
- 15-JUL-15 03.20.25.769000000 PM -> 2442
- 15-JUL-15 03.23.03.940000000 PM -> 2446
The second one is the latest. Im using Oracle 12C. So, the result of the query should be 2446.