Error 360: Cannot modify table or view used in subquery

后端 未结 1 2008
一个人的身影
一个人的身影 2021-01-22 06:27

INFORMIX-SE 7.32:

I\'m getting error 360 when I try to execute the following statement:

update transaction
   set transaction.colx = (select tab1.cola fr         


        
相关标签:
1条回答
  • 2021-01-22 07:10

    You're trying to UPDATE the table transaction and read from the same table using SELECT MAX with the same query. You cannot do that.

    Subquery restrictions

    In general, you cannot modify a table and select from the same table in a subquery. For example, this limitation applies to statements of the following forms:
    DELETE FROM t WHERE ... (SELECT ... FROM t ...);
    UPDATE t ... WHERE col = (SELECT ... FROM t ...);
    {INSERT|REPLACE} INTO t (SELECT ... FROM t ...);

    0 讨论(0)
提交回复
热议问题