Jump to content

Archived

This topic is now archived and is closed to further replies.

hc

Update with a JOIN statement

Recommended Posts

Any idea why this returns an error of

ERROR:  syntax error at or near "ims" at character 27

UPDATE imports.menssoccer ims
SET employee_id = uem.id
FROM ims
JOIN users.employees uem ON ims.ssn = uem.tax_id

Any help would be appreciated. Thanks

hc

Share this post


Link to post
Share on other sites
I don't think you can give an alias to the table being updated.

How about:
UPDATE imports.menssoccer
SET employee_id = uem.id
FROM users.employees uem
WHERE employee_id = uem.tax_id

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.