Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to get the latest Record

User_CC24UFeb 19 2021 — edited Feb 19 2021

sample.txt (9.43 KB)Hi Gurus,
I have a need to pull the history data from an employee table where the user status is terminated. The sample inserts are attached.
The output I need as below. The least record of an employee with status terminated, but if there are multiple recent terminations like 1134166 (3 terminated records), need to fetch the 3 record.

1134166 Aayushi Bhatnagar Terminated 22-JAN-21 15.07.15 22-JAN-21 15.08.07
1172439 Michael Tam Terminated 18-FEB-21 07.05.10 18-FEB-21 07.05.22
1215452 Mark Standrich Terminated 18-FEB-21 07.05.24 18-FEB-21 07.05.36

can you please help.

Comments
Post Details
Added on Feb 19 2021
3 comments
16,161 views