by GuyC » Tue Aug 11, 2009 4:46 pm
SELECT CUST_NMBR, LAST_UPDT_DT
INTO :WS-CUST-NMBR,:WS-LAST-UPDT
FROM CUST A
WHERE END_DT >= :WS-PARM-DATE
AND EFF_DT <= :WS-PARM-DATE
and last_upd_dt = (select max(B.ws-last-updt) from cust B where A.cust_nmbr = B.cust_nmbr and
b.END_DT >= :WS-PARM-DATE
AND b.EFF_DT <= :WS-PARM-DATE
)
without the sort , is another way of doing it.
I can explain it to you, but i can not understand it for you.