Delete all but one duplicate record

后端 未结 5 1740
猫巷女王i
猫巷女王i 2020-12-04 18:23

I have a table that is supposed to keep a trace of visitors to a given profile (user id to user id pair). It turns out my SQL query was a bit off and is producing multiple p

5条回答
  •  天命终不由人
    2020-12-04 18:34

    Select all unique rows
    Copy them to a new temp table
    Truncate original table
    Copy temp table data to original table

    That's what I'd do. I'm not sure if there's 1 query that would do all this for you.

提交回复
热议问题