According to your suggestion, the SELECTonly column that you really need is tatime.
If tatimeis a column on Table1, then I should check for existence in, and not join in Table2or Table3.
When combined with an Ollie offer, the request becomes
SELECT MAX(cov_julian(t.tatime))
FROM table1 t
WHERE t.tatime <= TO_NUMBER(TO_CHAR(SYSDATE,'J'))
AND (EXISTS (SELECT NULL
FROM table2 a
WHERE a.empid = t.personid)
OR EXISTS (SELECT NULL
FROM table3 c
WHERE c.col5 = t.personid2))
;
Tebbe source
share