I get an error message when I execute follow statement:
UPDATE dept d
SET city = ALL (SELECT city FROM locations l
WHERE d.location_id = l.location_id);
When I get rid of ALL operator, success.
UPDATE dept d
SET city = (SELECT city FROM locations l
WHERE d.location_id = l.location_id);
Can someone tell me what the “ALL” operator is?
ALLreserved word is for suqueries in select statements but not in UPDATE statement.Quoting Subqueries with ALL Oracle Doc:
That means that
=sign should be use as a comparation, not as assignation.If you expect that subquery resturns more than one row you can limit results with max or rownun: