title: Error in ORACLE SQL MERGE STATEMENT
body: <p>I'm trying to execute following code in Oracle 11g, and encountering to error..</p>
  
  <pre><code>MERGE INTO EMP_COPY4 C
  USING (SELECT E.EMPLOYEE_ID, E.FIRST_NAME, E.LAST_NAME, E.EMAIL, E.COMMISSION_PCT FROM EMPLOYEES) E
  ON (C.EMPLOYEE_ID = E.EMPLOYEE_ID)
  WHEN MATCHED THEN
  UPDATE SET
  C.FIRST_NAME = E.FIRST_NAME,
  C.LAST_NAME = E.LAST_NAME,
  C.EMAIL = E.EMAIL,
  C.COMMISSION_PCT = E.COMMISSION_PCT
  DELETE WHERE (E.COMMISSION_PCT IS NOT NULL)
  WHEN NOT MATCHED THEN
  INSERT VALUES (E.EMPLOYEE_ID, E.FIRST_NAME, E.LAST_NAME, E.EMAIL, E.COMMISSION_PCT);       
  </code></pre>
  
  <p>EMP_COPY4 is a copy table of EMPLOYEES and has only following columns EMPLOYEE_ID, FIRST_NAME, LAST_NAME, EMAIL, COMMISSION_PCT</p>
  
  <p>I TRY TO MERGE THEM ON CERTAIN CONDITIONS, BUT ORACLE GIVES FOLLOWING ERROR</p>
  
  <pre><code>Error starting at line : 405 in command -
  MERGE INTO EMP_COPY4 C
  USING (SELECT E.EMPLOYEE_ID, E.FIRST_NAME, E.LAST_NAME, E.EMAIL, E.COMMISSION_PCT FROM EMPLOYEES) E
  ON (C.EMPLOYEE_ID = E.EMPLOYEE_ID)
  WHEN MATCHED THEN
  UPDATE SET
  C.FIRST_NAME = E.FIRST_NAME,
  C.LAST_NAME = E.LAST_NAME,
  C.EMAIL = E.EMAIL,
  C.COMMISSION_PCT = E.COMMISSION_PCT
  DELETE WHERE (E.COMMISSION_PCT IS NOT NULL)
  WHEN NOT MATCHED THEN
  INSERT VALUES (E.EMPLOYEE_ID, E.FIRST_NAME, E.LAST_NAME, E.EMAIL, E.COMMISSION_PCT)
  Error at Command Line : 406 Column : 66
  Error report -
  SQL Error: ORA-00904: "E"."COMMISSION_PCT": invalid identifier
  00904. 00000 -  "%s: invalid identifier"
  *Cause:    
  *Action:
  </code></pre>
  
  <p>Line 405 is start of statement, line 406 is second line.</p>
  
  <p>Can you please help me to figure out why such error comes...?</p>