請參考下面的查詢:SQL服務器 - 建築更新where子句根據病情
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子句
去爲20K現在呢? ;) – mattytommo 2013-03-06 11:36:57
@mattytommo 100萬K;) – 2013-03-06 11:39:24
@mattytommo - 正好!目標是讓我的代表如此之高,這將導致一個堆棧溢出異常:o) – 2013-03-06 11:41:19