更新错误列参数不存在 [英] Update error column parameter does not exist
本文介绍了更新错误列参数不存在的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
尝试执行此查询时出现此错误:
Trying to execute this query I've this error:
Update failed. 3810: Column/parameter 'edw_workarea.A.A' does not exist.
我正在使用 Teradata 数据库.
I'm using Teradata database.
UPDATE A
FROM EDW_WORKAREA.bs A,
(
SELECT stg.ccir_ind_id,
stg.orig_ccir_id
FROM EDW_WORKAREA.se stg
INNER JOIN best_svc bc
ON stg.ccir_ind_id = bc.ccir_ind_id
WHERE stg.deliverability_score < '6'
AND stg.ccir_ind_id IN (SELECT stg.ccir_ind_id
FROM EDW_WORKAREA.se stg
WHERE stg.orig_ccir_id IS NULL
OR stg.orig_ccir_id = ''
GROUP BY
stg.ccir_ind_id
HAVING COUNT(*) = 1)
) t
SET A.orig_ccir_id = t.orig_ccir_id
WHERE A.ccir_ind_id = t.ccir_ind_id;
所有的表和列都存在于数据库中.并且 t 中的子查询单独执行成功.
All the tables and columns exist in database. And subquery in t was executing successfully alone.
谁能告诉我错误在哪里?
Can any one point me where the error is ?
推荐答案
在 Teradata 上,您不应该限定 SET 子句中的列,因此将 SQL 更改为类似:
On Teradata, you shouldn't qualify your columns in the SET clause, so change your SQL to something like:
update EDW_WORKAREA.bs
from (
select ...
) t
set orig_ccir_id = t.orig_ccir_id
where EDW_WORKAREA.bs.ccir_ind_id = t.ccir_ind_id;
这篇关于更新错误列参数不存在的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文