MySQL Error 1093 - Cant specify target table for update in FROM clause DELETE FROM story_category WHERE category_id NOT IN ( SELECT DISTINCT category id FROM category INNER JOIN story_category ON category_id=category id); But I get the next error: #1093 - You can't specify target table 'story_category' for update in FROM clause How can I overcome this?
mysql - Error Code: 1093. You cant specify target table c for update . . . You can't assign an alias in the Update portion Remove the alias entirely, Update labsd interns Set Accepted=1 or rewrite the query to move as c into the join statement UPDATE c SET Accepted = 1 FROM labsd grades as g JOIN labsd interns AS c ON c id = g id; Note you also can't have an Order By in a subquery without a top clause
You cant specify target table for update in FROM clause I don't think the reason is inane Think about the semantics Either MySQL has to keep a copy of the table before the update started, or the inner query might use data that has already been updated by the query as it's in progress Neither of these side-effects is necessarily desirable, so the safest bet is to force you to specify what will happen using an extra table
mysql - Error Code: 1093. You cant specify target table for update in . . . @ErgestBasha Thanks for replying I understood that I can't use the same table, however, what I do not understand is how SQL allows giving a row of table an alias of a table and considers it as a table? In this case (SELECT id FROM products WHERE purchase_date LIKE '2019%' ORDER BY purchase_date DESC LIMIT 1) returns one row, but an alias of a table is given
sql - MySQL Getting around error 1093 - Stack Overflow mysql sql sql-update sql-delete mysql-error-1093 edited Jul 11, 2015 at 23:46 Brian Tompsett - 汤莱恩 5,9277263135 asked Dec 19, 2010 at 19:53 bobobobo 67 9k67272375
sql - Error #1093 - Table is specified twice, both as a target for . . . The error I get is: '#1093 - Table 'deleteRequests' is specified twice, both as a target for 'DELETE' and as a separate source for data' I think the problem is that I'm using mariadb 10 2 (which also means I can't use WITH CTE)