# Workaround for MySQL's "can't specify target table for update in FROM clause" Error

DevFeed: [Workaround for MySQL's "can't specify target table for update in FROM clause" Error](<https://devfeed.tech/articles/workaround-for-mysql-s-can-t-specify-target-table-for-update-in-from-clause-error-28975.md>)

Original publisher: [Read original article](<https://blog.jooq.org/workaround-for-mysqls-cant-specify-target-table-for-update-in-from-clause-error/>)

Author: lukaseder

Published: 2023-12-20T14:20:29Z

Content type: tutorial

Language: en

Sources: [jOOQ](<https://devfeed.tech/sources/jooq.md>)

Topics: [MySQL](<https://devfeed.tech/topics/mysql.md>), [SQL](<https://devfeed.tech/topics/sql.md>), [bug](<https://devfeed.tech/topics/bug.md>), [rdbms](<https://devfeed.tech/topics/rdbms.md>)

Tags: [bug](<https://devfeed.tech/tags/bug.md>), [for-update](<https://devfeed.tech/tags/for-update.md>), [from-clause](<https://devfeed.tech/tags/from-clause.md>), [jooq-in-use](<https://devfeed.tech/tags/jooq-in-use.md>), [mariadb](<https://devfeed.tech/tags/mariadb.md>), [mysql](<https://devfeed.tech/tags/mysql.md>), [rdbms](<https://devfeed.tech/tags/rdbms.md>), [sql](<https://devfeed.tech/tags/sql.md>), [table](<https://devfeed.tech/tags/table.md>), [target-table](<https://devfeed.tech/tags/target-table.md>), [update](<https://devfeed.tech/tags/update.md>)

## AI overview

The article explains MySQL error 1093, which occurs when an UPDATE statement references its target table in a FROM clause. It presents a jOOQ transformation as a workaround and notes that similar workarounds appear in the MySQL documentation.

## Source excerpt

In MySQL, you cannot do this: The UPDATE statement will raise an error as follows: SQL Error [1093] [HY000]: You can't specify target table 't' for update in FROM clause People have considered this to be a bug in MySQL for ages, as most other RDBMS can do this without any issues, including MySQL clones: ... Continue reading Workaround for MySQL's "can't specify target table for update in FROM clause" Error ->