表格示例
id name value 1 value 2 1 disco numeber 1 0 2 disco numeber 2 0 3 cheese numeber 3 0 4 something numeber 4 0 5 something numeber 5 0
我想要一个代码来删除所有具有重复名称的行,并且只留下唯一的值。
结果应为
id name value 1 value 2 1 disco numeber 1 0 3 cheese numeber 3 0 4 something numeber 4 0
我有这段代码
delete from your_table
where id not in
select * from
( select min(id)
from your_table
group by user_id, badge_id ) x )
但它不起作用