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;
有任何想法吗?
您正在尝试UPDATE对该表transaction进行读取,并使用SELECT MAX同一查询从同一表中读取数据。你不能这样做。
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 ...);
DELETE FROM t WHERE ... (SELECT ... FROM t ...);
UPDATE t ... WHERE col = (SELECT ... FROM t ...);
{INSERT|REPLACE} INTO t (SELECT ... FROM t ...);