【update】update中無法用基於被更新表的子查詢,You can't specify target table 'test1' for update in FROM clause.
update中無法用基於被更新表的子查詢,You can‘t specify target table ‘test1‘ for update in FROM clause.
情況如下:
(1)第1行更新語句中,update表與子查詢中表一樣,所以報錯
(2)第2行更新語句中,update表與子查詢中表不一樣,所以可以執行。
如何解決?
把子查詢換成join即可。
例如:
【update】update中無法用基於被更新表的子查詢,You can't specify target table 'test1' for update in FROM clause.
相關推薦
【update】update中無法用基於被更新表的子查詢,You can39;t specify target table 39;test139; for update in FROM clause.
子查詢 src nbsp spec tab can 技術分享 例如 bubuko update中無法用基於被更新表的子查詢,You can‘t specify target table ‘test1‘ for update in FROM clause. 情況如下: (
關於mysql 5.7版本“報[Err] 1093 - You can39;t specify target table 39;XXX39; for update in FROM clause”錯誤的bug
title _id fma xxx tps ice sql each targe 不同於oracle和sqlserver,mysql並不支持在更新某個表的數據時又查詢了它,而查詢的數據又做了更新的條件,因此我們需要使用如下的語句繞過: UPDATE teaching_de
You can39;t specify target table 39;t_mail_marketing39; for update in FROM clause
update in table use pre RKE can stat mail date update t_mail_marketing set `STATUS` = 1 where ID in ( select b.PARENT_ID from (SELECT D
You can39;t specify target table 39;table39; for update in FROM clause
tar bsp stock select CA HA lec pan having delete from table1 where ID not in(select max(ID) ID from table1 group by row1) and row1 in
[Err] 1093 - You can39;t specify target table 39;master_data39; for update in FROM clause
sel master mce 沒有 AR delete 查詢 數據 select delete from master_data where category_id not in (select category_id from master_data a, bc_cate
You can39;t specify target table 39;t_open_user39; for update in FROM clause
https://blog.csdn.net/jiangyu1013/article/details/79108498 報錯如題,意思大致是:在一條 sql 語句中不能先查出來部分內容,再同時又對當前表作修改。 解決方法:給查詢加別名,用中間表來實現不是對同一表作操作。 如錯誤定法
MySQL:You can39;t specify target table for update in FROM clause
問題:You can't specify target table for update in FROM clause 含義:不能在同一表中查詢的資料作為同一表的更新資料。 注意:這個問題只出現於mysql,mssql和oracle不會出現此問題。 delete from people wher
錯誤:You can39;t specify target table 39;xxx39; for update in FROM clause的解決
參考:https://www.cnblogs.com/pcheng/p/4950383.html 解決: 程式碼: <!-- 執行"取消收藏" 操作 -> 根據前端傳入的商品id和sessio
[Err] 1093 - You can39;t specify target table 39;s1_test39; for update in FROM clause
前提說明:資料庫採用的是mysql。 資料庫表格: 題目: 刪除除了編號不同,其他資訊都相同的冗餘資訊。 思路: 1.找出除了編號不同,其他資訊不全相同的編號。 關鍵詞:group by……having :分組查詢,我對這個關鍵詞的理解是:不同的行之間找出列相同的一項或者
mysql修改刪除You can39;t specify target table for update in FROM clause的問題
you div code sql 語句 操作 查詢 重復數 -c sele 表中出現重復數據,需要刪除重復數據,只保留一條 DELETE FROM crm_participant WHERE id IN ( SELECT c.id cid F
【TensorFlow】PyCharm中無法識別tensorflow、numpy等Python庫問題的解決辦法
參考部落格https://blog.csdn.net/WIinter_FDd/article/details/72835939,準備使用貓狗資料集練習TensorFlow構建自己的圖片資料集TFrecords。使用pycharm敲入程式碼後,提示無法識別Python庫的問題。 1、問題現象如
【Excel】工作中會用到的excel操作和技巧
最近入職培訓,接受了一些企業文化的洗腦課,不過也有一些是很有實際應用的課程,比如excel操作和技巧,現將自己覺著很有用的地方總結如下: 1、基礎性操作與技巧 說在前面: 一個好的工作表格,需要主要以下幾點 : 首行首列要留白 外邊框要加粗 字型字號要
【資料庫】Mysql中主鍵的幾種表設計組合的實際應用效果
寫在前面 前前後後忙忙碌碌,度過了新工作的三個月。部落格許久未新,似乎對忙碌沒有一點點防備。總結下來三個月不斷的磨礪自己,努力從獨樂樂轉變到眾樂樂,體會到不一樣的是,連辦公室的新玩意都能引起莫名的興趣了,作為一隻忙碌的 “猿” 倒不知正常與否。 咳咳, 正題, 今天要寫一篇
MySQL 中 You can't specify target table '表名' for update in FROM clause錯誤
在MySQL中,寫SQL語句的時候 ,可能會遇到You can't specify target table '表名' for update in FROM clause這樣的錯誤,它的意思是說,不能先select出同一表中的某些值,再更新這個表(在同一語句中),即不能依據某
【Flume】flume中Avro Sink到Avro Source的效能測試,是否壓縮,是否加密
從官方下載的flume-ng的原始碼裡有單元測試的程式碼,本文就通過單元測試來體驗下flume中avro的效能如何 本文中的一個event的body內容大小是1KB,讀者可自行組織文字,達到1KB即可,方便測試時,效能的計算 先把我的程式碼貼出來 package flum
MySQL 中 You can't specify target table '表名' for update in FROM clause錯誤解決辦法
在MySQL中,寫SQL語句的時候 ,可能會遇到You can't specify target table '表名' for update in FROM clause這樣的錯誤,它的意思是說,不能先select出同一表中的某些值,再update這個表(在同一語句中),即
【C#】wpf中的xmlns名稱空間為什麼是一個網址,代表了什麼意思
新建一個wpf的專案,我們先來看下它預設的名稱空間都是哪些? 可以看到xmlns有的是網址,有的是clr-namespace開頭的一串字母。clr開頭的比較好理解,就是執行時的名稱空間,就像C#程式
MYSQL之You can't specify target table for update in FROM clause解決辦法
這篇文章主要介紹了mysql中You can’t specify target table for update in FROM clause錯誤解決方法,需要的朋友可以參考下 mysql中You can't specify target table for update
如何解決You can’t specify target table for update in FROM clause錯誤
mysql中You can’t specify target table for update in FROM clause錯誤的意思是說,不能先select出同一表中的某些值,再update這個表(在同一語句中)。 例如下面這個sql:delete from target_info_day where id
MySQL 錯誤碼: 1093 You can't specify target table 'jc_user' for update in FROM clause
MySQL 錯誤碼: 1093 You can’t specify target table ‘jc_user’ for update in FROM clause bug如何出現及解決方案 根據錯誤資訊可知:不能查詢一張表的同時修改同一張表