Update with Select from a non-existant column
slsam01May 7 2013 — edited May 9 2013Hello,
If I have two tables in Oracle database:
Table_1 has column id, c1, c2
Table_2 has column id, c1, c2
If I run the following select statement, it will give error, because column c3 does not exist:
select c3 from table_2;
However, if I run the following update statement, it run successfully with error. It shows, for example, 10 rows updated:
update table_1 t1 set t1.c2 =
(select t2.c3 from table_2 t2
where t2.id = t1.id);
Could someone explain to me what happens?
Regards!