I need to update a table from another table by joining them on APP_ID_NBR. I will set the ACCT_NBR = the ACCT_NBR on the subsequent select. Is there a more efficient way to write the query?
update $USER.${SANDBOX}BACKFILL A
set (ACCT_NBR
,LAST_MODIFIED_DATE) = (select B.ACCT_NBR
,CURRENT TIMESTAMP
from NMFP.KNSTG B
where A.APP_ID_NBR = B.APP_ID_NBR)
where ACCT_NBR IS NULL
and exists (select *
from NMFP.KNSTG C
where A.APP_ID_NBR = C.APP_ID_NBR);
COMMIT;
Thanks in advance.
Jeff