Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: sql statment
An UPDATE statement goes a little differently from a SELECT statement,
especially when more than one table is involved. You're getting an
invalid column because you never identified your second table.
Assuming you want the lowest type value to appear for identical id numbers (you say the 'first' value -- what does that mean?):
Try this:
UPDATE table_one t1 SET type=
(SELECT min(t2.type) FROM table_two t2 WHERE t2.id=t1.id)
![]() |
![]() |