查詢出有重復資料的某一條資料并保留下來 ;其他的做假洗掉處理 。
代碼:

使用這種方式報錯:
錯誤代碼: 1093
You can't specify target table 'i' for update in FROM clause
怎么解決這個問題 ? 有沒有其他解決方案?
uj5u.com熱心網友回復:
https://blog.csdn.net/z_youarethebest/article/details/53785487 可以參考下這個解決方案。mysql中You can't specify target table for update in FROM clause錯誤的意思是說,不能先select出同一表中的某些值,再update這個表(在同一陳述句中)。uj5u.com熱心網友回復:
delete s1.* from students s1,student s2 where s1.`name`=s2.`name` and s1.id>s2.id
uj5u.com熱心網友回復:
上面的SQL看起來,很優美~~~mark
轉載請註明出處,本文鏈接:https://www.uj5u.com/shujuku/79506.html
標籤:MySQL
上一篇:用mysql資料庫匯入access里面mdb格式的檔案的時候,顯示invalid variant operation匯入不了怎么解決
下一篇:bson格式
