MySQL更新時Error Code:1093和Error Code:1175的解決辦法
Jun 07, 2016 pm 05:31 PMError Code: 1093. You can
Error Code: 1093. You can't specify target table 'ws_product' for update in FROM clause
這個是我們在使用update或者delete語句時,在where條件里面加入的子查詢導(dǎo)致的。例如如下的update語句:
update table set type = 'static' where id in (
select id from ws_product where first_name ='superman'
);
修改上述語句為下面這樣,,該問題可以解決:
update ws_product set type = 'static' where id in (
select id form (
?select id from ws_product where first_name ='superman'
) xx
);
注意,這樣一定要給最里面的子查詢定義一個別名,不然會報另外一個錯誤:
Error Code: 1248. Every derived table must have its own alias
Error Code: 1175. You are using safe update mode and you tried to update a table without a WHERE that uses a KEY column To disable safe mode, toggle the option in Preferences -> SQL Queries and reconnect.
解決辦法是在當(dāng)前session下執(zhí)行如下的語句
SET SQL_SAFE_UPDATES = 0;
然后再執(zhí)行Update語句
相關(guān)閱讀:
MySQL ERROR 1044 (42000) 解決方法
MySQL ERROR 1005 (HY000): Can't create table 'schema_name.table_name' (errno: 150)?
MySQL ERROR 1045 (28000): Access denied for user 'root'@'localhost'? ?
MySQL安裝出現(xiàn)could not start the service mysql error:0處理 ?

? AI ??

Undress AI Tool
??? ???? ??

Undresser.AI Undress
???? ?? ??? ??? ?? AI ?? ?

AI Clothes Remover
???? ?? ???? ??? AI ?????.

Clothoff.io
AI ? ???

Video Face Swap
??? ??? AI ?? ?? ??? ???? ?? ???? ??? ?? ????!

?? ??

??? ??

???++7.3.1
???? ?? ?? ?? ???

SublimeText3 ??? ??
??? ??, ???? ?? ????.

???? 13.0.1 ???
??? PHP ?? ?? ??

???? CS6
??? ? ?? ??

SublimeText3 Mac ??
? ??? ?? ?? ?????(SublimeText3)

?? ?? ? ?? ?? ??? ??? ??? ?????? ?? ??? ??? ?????? ??? ?????? ?????? ??? ?????. ? ?? ?? ???? ????. ??, ??????, ??? ? ??? ?? ??? UTF8MB4? ???? ???? ShowCreatedAtabase/Table? ???? ? Alter ??? ??????. ??, ?????? ??? ? UTF8MB4 ?? ??? ???? ?? ?? ??? ????? SetNames? ??????. ??, ?? ??? ????? ???? UTF8MB4_UNICODE_CI? ???? ?? ? ????? ???? ???? ?????? ???? ?? ? ? ?? ?? ??? ????? ??????.

MySQL? ???? ??? ???? InnoDB ?? ??? ???? ??? ???? ???? ?????. 1. ????? ??? SQL ?? ????, ?? ?? ?? ?? ??? ?????. 2. ? ???? ???, ???, ?? ? ???? ?????. 3. ????? ???? ????? ??? STARTTRANSACTION, CONMING ? ROLLBACK???. 4. 4 ?? ?? ???? ?? ??, ?? ? ??, ?? ??? ?? ? ???? ?????. 5. ????? ???? ???? ?? ??? ??? ?? ??? ?? ?? ? ??? ????? ??????. ??? ????? ?? MySQL? ?? ???? ?? ??? ?? ? ? ????.

CTE? MySQL8.0?? ?? ? ???? ??? ??? ??? ? ?? ??? ??????. 1. CTE? ?? ?? ??? ?? ????? ???? ??? ??? ??? ?? ??? ?????. 2. ?? ??? ???? CTE? ? ?? ?? ??? ???? ????????. 3. ?? CTE? ?? ??? ?? ?? ? ???? ?? ? ? ?????, ?? ?? ?? ? ?? ??? ???????. 4. ?? ???? ?? ??, ?? ?? ??, ????? ?? ? ??? ??? ?????.

MySQL ?? ?? ???? ???? ??? ??, SQL ?? ???, ??? ?? ?? ? ???? ??, ?? ? ???? ?? ??? ???? ?? ??? ???????. 1. ??? ?? ????? : ????? ???? ?? ???? ?? ??, ?? ??? ??? ???, ?? ? ??? ?????? ????, ??? ??? ?? ???? ???? ???, ?? ???? ?????. 2. SQL ?? ??? : ??*? ???, ???? ??? ???? ??, ?? ?? ??? ???, ??? ?? ??? ???????. 3. ??? ?? ?? ? ???? : ?? ? ?? ????? ?? ???? ?? ?? ??? ????, ??? ?? ??? ????, ????? ???? ????, ?? ???? ???? ????? ???? ???? ?????. 4. ?? ? ???? ?? : Redis ??? ???? ?????? ??? ??? ?? ??? ???????.

??? ??? MySQL ?? ???? ????? 1. ?? RTO ? RPO ???? ????? ????? ?? ??? ?? ?? ? ??? ?? ??? ???? ?? ?? ? ??? ??????. 2. ?? ?? ? ?? ??? ??? ???? ?? ?? ?? (? : MySQLDump), ??? ?? (? : PerconaxTrabackup) ? Binlog (Binlog) ? Binlog (Binlog)? ???? ????? ?? ??? ?????. 3. ??? ??? ???? ?? ??? ??? ??? ?? ????? ????? ???????. 4. ?? ??? ????, ??? ??, ?? ?? ?? ? ?? ?? ????? ??? ???? ?????? ??????.

toptimizecomplexjoinoperationsinmysql, followfourkeysteps : 1) 1) ?? ComproperIndexingOnbothsidsidesofjoincolumns, ?? ComporIteIndexesFormulti-ColleumnJoinsandavoidinglargeVarCharIndexes; 2) ?? ? ?? ????

MySQL? ??? ?? ?? ??? ???? ? ???? ?????. ?? ?? ?? ??? ???? ?? ????? ? ? ????. 1. ?? ???? ID, select_type, ???, ??, ?, ?? ?? ?????. 2. ???? ??? ?????? ??????? (? : const, eq_ref? ?? ????), ? (??? ??? ?? ??) ? ?? (Filesort ?? ? ???? ???); 3. ?? ??? ?? : ?? ??? ???? ??? ?? ??? ??? ????? ?? ??? ?? ??? ???? ?? ?? ??? ????? ???? ?? ? ??? ??? ????? ??? ????? ??? ????.

MySQL ??????? Excel? ???? ? ?? ??? ????. 1. PowerQuery ?? : MySQLODBC ????? ?? ? ? Excel? ?? ? PowerQuery ??? ?? ?? ? ?? ?? ???? ?? ? ? Timed Refresh? ?????. 2. MySQLForexcel ???? ?? : ?? ????? ??? ?????? ???? ??? ??? ? ??? ?? ??? MySQL? ?? ???? ?? ??????? ?????. 3. VBA ADO ????? ?? : ?? ????? ???? ??? ??? ???? ??? ?? ? ??? ??????. ??? ??? ?? ??? ?? ??? ??? ??????. PowerQuery ?? MySQlforexcel? ?? ???? ? ???? VBA? ?? ??? ? ????.
