同表不支持update子查询的结果()

[root@db01 /data/backup]# mysql.dba zhouwanchun

[root@localhost:mysql3306.sock] [zhouwanchun]> UPDATE work_flow_event
SET process_status = '3', process_message = '审批拒绝'
WHERE flow_no IN (
        SELECT flow_no
        FROM work_flow_event
        WHERE flow_no IN (
                SELECT flow_no
                FROM work_flow
                WHERE flow_data -> '$.customerNumber' = '101379'
                    AND flow_key LIKE 'price%'
                    AND flow_data -> '$.endTime' < '2021-05-11'
                    AND curr_node = '02'
            )
            AND node_code = '02'
    );
ERROR 1093 (HY000): You can't specify target table 'work_flow_event' for update in FROM clause
[root@localhost:mysql3306.sock] [zhouwanchun]> UPDATE work_flow_event
SET process_status = '3', process_message = '审批拒绝'
WHERE flow_no IN (select * from (
        SELECT flow_no
        FROM work_flow_event as a
        WHERE a.flow_no IN (
                SELECT b.flow_no
                FROM work_flow as b
                WHERE b.flow_data -> '$.customerNumber' = '101379'
                    AND b.flow_key LIKE 'price%'
                    AND b.flow_data -> '$.endTime' < '2021-05-11'
                    AND b.curr_node = '02'
            )
            AND a.node_code = '02'
            ));
ERROR 1248 (42000): Every derived table must have its own alias
[root@localhost:mysql.sock] [zhouwanchun]> UPDATE work_flow_event
SET process_status = '3', process_message = '审批拒绝'
WHERE flow_no IN (select * from (
        SELECT flow_no
        FROM work_flow_event as a
        WHERE a.flow_no IN (
                SELECT b.flow_no
                FROM work_flow as b
                WHERE b.flow_data -> '$.customerNumber' = '101379'
                    AND b.flow_key LIKE 'price%'
                    AND b.flow_data -> '$.endTime' < '2021-05-11'
                    AND b.curr_node = '02'
            )
            AND a.node_code = '02'
            ) as b);
Query OK, 0 rows affected (0.72 sec)
Rows matched: 3644  Changed: 0  Warnings: 0

— 总结

————————
[root@db01 /data/backup]# mysql.dba zhouwanchun

[root@localhost:mysql3306.sock] [zhouwanchun]> UPDATE work_flow_event
SET process_status = '3', process_message = '审批拒绝'
WHERE flow_no IN (
        SELECT flow_no
        FROM work_flow_event
        WHERE flow_no IN (
                SELECT flow_no
                FROM work_flow
                WHERE flow_data -> '$.customerNumber' = '101379'
                    AND flow_key LIKE 'price%'
                    AND flow_data -> '$.endTime' < '2021-05-11'
                    AND curr_node = '02'
            )
            AND node_code = '02'
    );
ERROR 1093 (HY000): You can't specify target table 'work_flow_event' for update in FROM clause
[root@localhost:mysql3306.sock] [zhouwanchun]> UPDATE work_flow_event
SET process_status = '3', process_message = '审批拒绝'
WHERE flow_no IN (select * from (
        SELECT flow_no
        FROM work_flow_event as a
        WHERE a.flow_no IN (
                SELECT b.flow_no
                FROM work_flow as b
                WHERE b.flow_data -> '$.customerNumber' = '101379'
                    AND b.flow_key LIKE 'price%'
                    AND b.flow_data -> '$.endTime' < '2021-05-11'
                    AND b.curr_node = '02'
            )
            AND a.node_code = '02'
            ));
ERROR 1248 (42000): Every derived table must have its own alias
[root@localhost:mysql.sock] [zhouwanchun]> UPDATE work_flow_event
SET process_status = '3', process_message = '审批拒绝'
WHERE flow_no IN (select * from (
        SELECT flow_no
        FROM work_flow_event as a
        WHERE a.flow_no IN (
                SELECT b.flow_no
                FROM work_flow as b
                WHERE b.flow_data -> '$.customerNumber' = '101379'
                    AND b.flow_key LIKE 'price%'
                    AND b.flow_data -> '$.endTime' < '2021-05-11'
                    AND b.curr_node = '02'
            )
            AND a.node_code = '02'
            ) as b);
Query OK, 0 rows affected (0.72 sec)
Rows matched: 3644  Changed: 0  Warnings: 0

— 总结