获取列参数在 Teradata 中不存在错误

Getting column parameter doesn't exist error in Teradata

update t1
from 
table1 t1,
table2 t2
set
t1.active_ind=0,
t1.row_status_cd='L'
where
t2.col1
is NULL

在 Teradata SQL 中出现“列/参数 table 1.t1 不存在”错误,尽管这些字段在 t1 中可用。有人可以帮我解决这个问题吗?

因为您只需要更新表 1,所以不需要在 SET 中列名之前的 t1,这就是您收到错误的原因。

但 table1 和 table2 之间不应该有关系,但一如既往,您应该在使用它之前先对其进行测试,wquery 可能会产生无法预料的副作用

update t1
from 
    table1 t1,
    table2 t2
set
    active_ind=0,
    row_status_cd='L'
where
    t2.col1 is NULL