且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何删除两个完全相同的行之一?

更新时间:2023-11-30 19:52:40

解决问题的一种方法是使用相同的架构创建一个新表,然后执行以下操作:

One option to solve your problem is to create a new table with the same schema, and then do:

INSERT INTO new_table (SELECT DISTINCT * FROM old_table)

然后重新命名表.

您当然需要大约与表所需的磁盘空间相同的磁盘空间!

You will of course need approximately the same amount of space as your table requires spare on your disk to do this!

效率不高,但是非常简单.

It's not efficient, but it's incredibly simple.