Reputation: 960
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 ?
Upvotes: 1
Views: 9759
Reputation: 10690
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;
Upvotes: 2