update(select)
select update
----------------------------------------
UPDATE (SELECT A.ORDER_APPROVED AS ORDER_APPROVED
,A.MAKE_YEAR AS MAKE_YEAR
,A.MAKE_NO AS MAKE_NO
,A.UPDATE_USID AS UPDATE_USID
,A.UPDATE_DT AS UPDATE_DT
,A.MAKING_DATE AS MAKING_DATE
FROM TB_ELVTRNO_ORDER A
WHERE A.ORDER_YN = 'Y'
)
SET ORDER_APPROVED = (ORDER_APPROVED + 1)
,UPDATE_USID = #ORDER_USID#
,UPDATE_DT = SYSDATE
,MAKE_YEAR = TO_CHAR(SYSDATE, 'YYYY')
,MAKE_NO =(SELECT DECODE(MAX(B.MAKE_NO), '', '01', LPAD(TO_NUMBER(MAX(B.MAKE_NO) + 1), 2, '0')) AS MAXMAKENO FROM TB_ELVTRNO_ORDER B WHERE MAKE_YEAR = TO_CHAR(SYSDATE, 'YYYY'))
,MAKING_DATE = SYSDATE