I was trying to update a table that using sql join but I kept getting ORA-00933
I tried the following:
Using A SQL JOIN In A SQL UPDATE Statement Using A SQL JOIN In A SQL UPDATE Statement (www.bennadel.com)
update table using inner join (venushuynh.wordpress.com)
but I kept getting the ORA-00933
then tried this Oracle Update with Join (geekswithblogs.net) but still didn’t work.
After some deep search I’ve found my error in a oracle forum: SQL Error: ORA-01779: cannot modify a column which maps to a non key-preser
Even though it’s not the same ORA error it fixed the problem nonetheless
Here my sql statement that worked for me:
UPDATE mytable m
set m.status=7
where m.id in (select mytable.id from mytable inner join otherTable on mytable.matchid=othertable.matchid where othertable.userid=1234)
Recent Comments