title: This query runs fine, but as an update statement in Oracle it fails
body: <pre><code>SELECT  arinvt.buyer_code_id
  FROM arinvt
  LEFT JOIN arinvt_vendors
  ON arinvt.ID = arinvt_vendors.ARINVT_ID
  where arinvt_vendors.vendor_id like 61690 
  and arinvt_vendors.is_default ='Y' 
  and arinvt.buyer_code_id is null
  
  update arinvt 
  set arinvt.buyer_code_id = 66 
  SELECT arinvt.buyer_code_id 
  FROM arinvt 
  LEFT JOIN arinvt_vendors 
  ON arinvt.id = arinvt_vendors.arinvt_id 
  (where arinvt_vendors.vendor_id like 61690 
  and arinvt_vendors.is_default ='Y' 
  and arinvt.buyer_code_id is null)
  </code></pre>
  
  <blockquote>
    <p>SQL Error: ORA-00933: SQL command not properly ended
    00933. 00000 -  "SQL command not properly ended"
    *Cause:    </p>
    
    <h2>&lt; *Action:</h2>
  </blockquote>
  
  <p>I looked at the other (duplicate) question before I posted mine and tried this Update:</p>
  
  <p>UPDATE 
      ( SELECT arinvt.buyer_code_id
               FROM arinvt
          LEFT JOIN arinvt_vendors ON arinvt.id = arinvt_vendors.arinvt_id
        where arinvt_vendors.vendor_id like 61690 and arinvt_vendors.is_default ='Y'
        and arinvt.buyer_code_id is null
       )x
  SET arinvt.buyer_code_id = 66</p>
  
  <p>and I get:</p>
  
  <p>Error report -
  SQL Error: ORA-00904: "ARINVT"."BUYER_CODE_ID": invalid identifier
  00904. 00000 -  "%s: invalid identifier"
  *Cause:<br>
  *Action:</p>
  
  <p>I'm not sure what I'm doing wrong. Can someone help please, we need this to fix our production system.</p>