I need a statement to update a field on one table based on data found in a field on another table. The user login ID can be found on the Tracker table. I would like to populate the user login ID on a new field I just created on the Assignee table.
Tracker loginID Assignee heatlogin
John Smith SMITHJOH John Smith
Jill Hope HOPEJIL Jill Hope
Larry Fine FINELAR Larry Fine
First I tried:
This gave me an error "SQL command not properly ended"
So I tried:
But that gives me the message "single row sub-query returns more than one row"
So it seems like that I need some addition to this last statement that will enable the multiple records from the sub-query to populate the field...what am I missing?
Tracker loginID Assignee heatlogin
John Smith SMITHJOH John Smith
Jill Hope HOPEJIL Jill Hope
Larry Fine FINELAR Larry Fine
First I tried:
Code:
UPDATE assignee
SET heatlogin = tracker.loginid
from assignee, tracker
where assignee.assignee = tracker.fullname
This gave me an error "SQL command not properly ended"
So I tried:
Code:
update ASSIGNEE
set HEATLOGIN =
(
select TRACKER.LOGINID from TRACKER
where TRACKER.FULLNAME = ASSIGNEE.ASSIGNEE
);
But that gives me the message "single row sub-query returns more than one row"
So it seems like that I need some addition to this last statement that will enable the multiple records from the sub-query to populate the field...what am I missing?