mysql - 我的表有唯一的id,删除重复记录

标签 mysql sql

In this image there are two kavya with differnt id's ... but every field same for that 2 rows... I need to echeck atleast 5 fields and if those five fileds are found to be same means i want to delete one row and keep one在我的数据库中存储了重复记录..除了 id 之外的每一列对于两行都是相同的...现在我需要删除两条重复记录中的一条记录并保留一条安全

最佳答案

Delete from table_Name A
Where exists (select 1 
From table_Name B
Where A.id = B.id
);

关于mysql - 我的表有唯一的id,删除重复记录,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58354487/

相关文章:

mysql - 非常简单的 MySQL SELECT 语句导致错误

mysql - 通过在其之前添加文本来更新所有行

php - 用于 ips 的大型 mysql 数据库

php - SQLSTATE[HY000] [2002] 连接超时

sql - 创建连接多个表的数据库 View

sql - 在 Postgres 中更改列类型会导致 pg_attrdef 警告

mysql - SQL 模式是 NO_UNSIGNED_SUBTRACTION 但仍然出现超出范围错误

php - 将字段添加到数据库/覆盖现有下拉列表中的默认选项

php - 选择小于或等于当前日期的日期

sql - 如何在SQL中执行T9搜索方法?