请帮我调整下面提到的更新声明,
UPDATE t_cust
SET cust_name = td.cust_name,
cust_desc = td.cust_desc
FROM t_cust tc
JOIN t_data_cust td ON tc.cust_nr = td.cust_nr
AND tc.start_validity_date = ISNULL(@execution_date,td.start_validity_date)
AND (td.adj_id = @adj_id OR @adj_id IS NULL)
AND ( td.ln_status = '0')
WHERE td.cust_name <> tc.cust_name
OR td.cust_desc <> tc.cust_desc
答案 0 :(得分:-1)
将WHERE
语句移至JOIN
条件。
否则它应该运行良好,如果仍然没有,请提供更多信息。