mysql delete 有表別名刪除不了?


sql 裏面如果有表別名 則要 'delete 表別名 from',如果沒有表別名使用'delete from'就行了。

 

如下是錯誤:

delete from info i where i.ID >=738 and i.ID <=741;

 

報錯:

表別名附近報錯了,

改成:delete i from info i where i.ID >=738 and i.ID <=741; 

  或者:delete  from info  where info.ID >=738 and info.ID <=741; 

 

oracle 則沒有這種情況,直接delete from 就行了

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章