删除重复的数据 spawns 表中 有重复的数据 库 重复的字段是position_x 和 position_y ID字段是排序的嘛就是 1234... 我想把 表 spawns 中 字段 position_x 和 position_y 一样的2条数据 删除一条就 行了.. 这句子怎么写呢 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 delete from spawns where exists (select position_x, position_y from spawns group by position_x,position_y having count(*) > 1) and not exists (select min(ID) from spawns group by position_x,position_y having count(*)>1);这样写哪里不对 ID position_x position_y 这和进字段1 2 32 3 43 2 3position_x position_y 重复的有 1和3行 要么删除第1行 要么删除第3行这样的语句怎么写.谢谢 ID就是标识一条记录的字段delete a from tt a left join b on a.position_x=b.position_x and a.id>b.id delete a from yourTable a inner join yourTable b on a.position_x=b.position_x and a.position_y=b.position_ywhere a.id>b.id delete from test where id not in (select * from (select min(id) from test group by userid,addtime) a); 保留ID最小那条:delete a from 表 a where not exists (select 1 from 表 b where b.position_x=a.position_x and b.position_y=a.position_y and b.id<a.id) 关于ACCESS链接MYSQL表后,主键的问题 PostgreSQL 如何字符串解析成表? 在数据中设置排序的序列号 SQL语句 通过SQLSERVER产生的脚本在MYSQL中建立数据库,可是原来的表之间的关系该如何引入MYSQLA 想学MYSQL不知道该怎么入门 phpadmin工具如何把MYSQL(繁体)导从excel且不生成乱码 求一SQL语句 MySQL数据库错误:Communications link failure 求助,重启Linux之后远程访问MySQL失败 急,高手帮帮忙看看一个sql mysql数据库,varchar属性字段,为什么中文的横线无法插入呢?
1 2 3
2 3 43 2 3
position_x position_y 重复的有 1和3行 要么删除第1行 要么删除第3行这样的语句怎么写.谢谢
delete a from tt a left join b on a.position_x=b.position_x and a.id>b.id
where a.id>b.id
delete a from 表 a where not exists (select 1 from 表 b where b.position_x=a.position_x and b.position_y=a.position_y and b.id<a.id)