Deleting duplicate rows with sql

后端 未结 5 811
滥情空心
滥情空心 2021-01-17 03:59

I am trying to delete duplicate rows from my mysql table. I\'ve tried multiple queries but I am keep on getting this error: #1093 - You can\'t specify target table \'usa_cit

5条回答
  •  无人及你
    2021-01-17 04:25

    Edit : This solution is also found if you follow the link posted by BloodyWorld, so if it works please go and upvote DMin's post here

    Found this browsing the internet (#1 google result for mysql delete duplicate rows), have you tried it?

    delete from table1
    USING table1, table1 as vtable
    WHERE (NOT table1.ID=vtable.ID)
    AND (table1.field_name=vtable.field_name)
    

提交回复
热议问题