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!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

Fetch the MInimum Effective Start Date on the Employees latest Department/Organization_ID

Philip P.6 days ago

SQL to return Effective Start Date based on Organization ID. If the Dept did not change since the new hire then the Eff Date should be the first effective start date rather than the current Eff Start Date based on any other changes

Below are the sample scenarios w/ expected output….

I already have an SQL for this, however it has 2 issues that I am still working on.

  1. Single Row Subquery error (where Sysdate equals to the Effective Start Date wherein there are 2 changes in the Org_ID on the same date, assuming I run this on March 31 2024)

  1. Wrong eff_start_date is being pulled if it follows a date with the same scenario above.

Expected output is 12-10-2023

Being pulled in the report is 10-29-2023

Maybe you can help me re-construct my SQL below to satisfy this conditions and be able to pull the correct date. Thanks

Comments
Post Details
Added 6 days ago
2 comments
66 views