I am just learning Oracle after having an Access SQL Server background and the SQL is killing me. The joins work so differently. If I just had some base code to start with I would be off and running.
What I am trying to do here is update a table (A) with a value that determine by looking at another table. Both tables have a common field that should be one to one (vPATH). The way I set it up below I get the 'subquery returns more than one result error'. I know the subquery returns more than one row, I want to update all vPATH values in A where the subquery returns results.
Any suggestions?
UPDATE A
SET A.UNIT = 'M' WHERE
A.vPATH =
(SELECT B.vPATH
FROM B WHERE
B.X_CENTROID < 3850000 AND B.X_CENTROID > 3000000
AND B.Y_CENTROID < 2250000 AND B.Y_CENTROID > 980000)
What I am trying to do here is update a table (A) with a value that determine by looking at another table. Both tables have a common field that should be one to one (vPATH). The way I set it up below I get the 'subquery returns more than one result error'. I know the subquery returns more than one row, I want to update all vPATH values in A where the subquery returns results.
Any suggestions?
UPDATE A
SET A.UNIT = 'M' WHERE
A.vPATH =
(SELECT B.vPATH
FROM B WHERE
B.X_CENTROID < 3850000 AND B.X_CENTROID > 3000000
AND B.Y_CENTROID < 2250000 AND B.Y_CENTROID > 980000)