0

I have an update statement that is working in Mysql.(update multiple records, based on the column in another table)

UPDATE  `table1` m 
INNER JOIN
(SELECT cse_cd FROM  table2 WHERE clsf_ind='NC') t 
ON m.cse_cd = t.cse_cd 
SET m.ST_CD = 'QUEST03'

However, it does not work in Oracle. Can somebody help on this.

Prasanna Nandakumar
  • 4,295
  • 34
  • 63

1 Answers1

2

This should do the job:

UPDATE table1 
SET ST_CD = 'QUEST03'
WHERE EXISTS 
     (SELECT 1 
      FROM table2 
      WHERE clsf_ind='NC' AND table1.cse_cd=table2.cse_cd); 
Simon
  • 1,605
  • 13
  • 22