update from another table

Post Reply
sourceuno
Posts: 225
Joined: Mon Apr 09, 2001 3:58 pm

update from another table

Post by sourceuno »

Is it possible to set a field in one table to be equal to another field in another table using an update statement?
User avatar
John
Site Admin
Posts: 2622
Joined: Mon Apr 24, 2000 3:18 pm
Location: Cleveland, OH
Contact:

update from another table

Post by John »

Yes, there are two ways you could do it. The simplest is using Vortex, and select the value first, and then do the update. You can also use a subquery in the update, for example:

update test set y = (select j from test2 where test2.i = test.x);
John Turnbull
Thunderstone Software
Post Reply