>I need to update a column in one table with data from another table, but I can not get the syntax right. Basically what I want to do is:
>
>UPDATE Table1
>SET Table1.Staff_ID = Table2.KeyID
>WHERE Table1.Location = Table2.Location
>
>The Location column in each table is unique. TIA!
Try this
UPDATE table1
SET staff_id = (SELECT keyid
FROM table2
WHERE table2.keyid = table1.staff_id
AND table2.location = table1.location)
Or perhaps a derivitive of this.
HTH,
William Chadbourne
Senior Programmer/Analyst
State of Maine - DAFS App Team
Oracle - When you care enough to use the very best!!