Update error column parameter does not exist

Deadly 提交于 2019-12-11 06:16:12

问题


Trying to execute this query I've this error:

Update failed. 3810: Column/parameter 'edw_workarea.A.A' does not exist.

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;

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 ?


回答1:


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;


来源:https://stackoverflow.com/questions/18658507/update-error-column-parameter-does-not-exist

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!