请参阅以下查询:
Update Employee
Set AccountManagerId = a.AM_ID
FROM Employee e INNER JOIN AccountManager a on e.Id = a.Id
WHERE
**努力构造下面的部分(需要添加到where子句中)**
If a.Department is not null then [FOLLOWING NEEDS TO BE ADDED TO WHERE CLAUSE] (e.Department = a.department)
努力将其添加到 where 子句。因此,如果部门不为 NULL,则将其添加到 WHERE 子句