Hello everyone,

I am a new Oracle DBA by accident not by trade and would greatly appreciate suggestions for the below query that is running very slow (more than 30 minutes and counting). I used the SQL Optimizer from Toad but it was unable to find a faster alternative for me. I've heard about self joins not sure if this is an option for this statement? I don't know much of anything in SQL or PL/SQL would appreciate your recommendations. Thank you!

select a.EMPLID
from ps_job a
where (a.effdt = (select max(b.effdt) from ps_job b where b.emplid = a.emplid)
and a.effseq = (select max(c.effseq) from ps_job c where c.emplid = a.emplid and c.effdt = a.effdt)
and a.empl_rcd = (select max(d.empl_rcd) from ps_job d where d.emplid = a.emplid and d.effdt = a.effdt and d.effseq = a.effseq ))