Originally posted by Susan Monz: Hi, I need help with this query. Can someone tell me whats wrong or even suggest a better way.
SELECT B.DOCNO, B.APPROV_REM FROM B WHERE B.DOCNO = ((SELECT A.DOCNO FROM A WHERE A.DOCDT=(SELECT MAX(C.DOCDT) FROM C WHERE C.EMPNO = :1) AND A.EMPNO = C.EMPNO)) Here A and C are the same tables.
Without knowing what you're doing... you should make sure your sub-query produces the correct results before adding it to your main query... also.. if A is the same as C... there is no reason to use both A and C (or even for the existence of C) for your query. [ October 07, 2008: Message edited by: Paul Campbell ]