INFORMIX-SE 7.32:
当我尝试执行以下语句时,我收到错误360:
update transaction
set transaction.colx = (select tab1.cola from tab1)
where transaction.num = (select max(transaction.num) from transaction)
and transaction.colx IS NULL;
有什么想法吗?
答案 0 :(得分:4)
您正尝试UPDATE
表transaction
并使用SELECT MAX
使用相同的查询从同一个表中读取。你不能这样做。
通常,您无法修改表并从子查询中的同一个表中进行选择。例如,此限制适用于以下形式的陈述:
DELETE FROM t WHERE ... (SELECT ... FROM t ...);
UPDATE t ... WHERE col = (SELECT ... FROM t ...);
{INSERT|REPLACE} INTO t (SELECT ... FROM t ...);