Thread: Update with two tables??

Update with two tables??

From
Mark
Date:
I am trying to update table A with data from table B. I thought I could do
something like:

UPDATE A
SET A.name = B.name
WHERE A.id = B.id
FROM B

but alas, this does not work.

Anyone have an idea of how I can do this?

-Mark


-----------------------------------------------------------------  Mark Lundquist  mlundquist@bvsdps.com
-----------------------------------------------------------------




Re: [SQL] Update with two tables??

From
Fomichev Michael
Date:
On Wed, 16 Jun 1999, Mark wrote:

> I am trying to update table A with data from table B. I thought I could do
> something like:
> 
> UPDATE A
> SET A.name = B.name
> WHERE A.id = B.id
> FROM B
> 
> but alas, this does not work.
> 
> Anyone have an idea of how I can do this?

It works. But you don't need A.name:UPDATE ASET name = B.nameFROM BWHERE A.id = B.id;


@------------------+-----------------------------------------------@
| Fomichev Mikhail | The Government of Kamchatka region.           |
| Vladimirovich    | The Labour and Social Development Department. |
|<fomichev@null.ru>|                                               |
@------------------+-----------------------------------------------@