当我使用update
在Join
查询下方触发时,我收到以下错误。请帮我解决这个问题。
SQL错误:ORA-00904:“STATUS”:标识符无效 00904. 00000 - “%s:无效标识符”
查询是:
UPDATE (
SELECT
a.COLUMN_35,
a.network_nni
FROM
Table_1 a
JOIN Table_2 b
ON a.COLUMN_35 = b.COLUMN_35
AND a.network_id = b.network_id
WHERE b.COLUMN_35 IS NOT NULL
AND a.status = 'Status_1'
)
SET status = 'Status_2';
请检查并最早建议。
答案 0 :(得分:1)
您需要更新a.status列,以便在select语句中选择该列
尝试以下查询
update
(select a.status as Stat
from Table_1 a
JOIN Table_2 b ON
a.COLUMN_35=b.COLUMN_35
and a.network_id= b.network_id
where b.COLUMN_35 is not null
and a.status='Status_1') b
set b.stat = 'Status_2';