My Oracle Support Banner

Error: 1093 SQLSTATE: HY000 (ER_UPDATE_TABLE_USED) (Doc ID 1023934.1)

Last updated on MARCH 31, 2017

Applies to:

MySQL Server - Version 4.0 and later
Information in this document applies to any platform.

Goal

A table can not be referred to in a sub-select when that table is being updated.The following is an example of this:

CREATE TABLE table1 (col1 INT);
INSERT INTO table1 (col1)
VALUES (1);

UPDATE table1
SET col1 = 10
WHERE col1 IN (SELECT col1 FROM table1);

ERROR 1093 (HY000): You can't specify target table 'table1' for update in FROM clause

Solution

To view full details, sign in with your My Oracle Support account.

Don't have a My Oracle Support account? Click to get started!


My Oracle Support provides customers with access to over a million knowledge articles and a vibrant support community of peers and Oracle experts.