delete table
from table a,
(
	select b.val1 ,b.val2 ,COUNT(1) as cnt
	from table b
	group by b.val1 ,b.val2 
	haval1g COUNT(1) > 1
)b
where a.val1 = b.val1 and a.val2 = b.val2
and a.id not in (
	select MAX(id) as id
	from table a
	group by val1 ,val2 
	haval1g COUNT(1) > 1
)

  

相关文章:

  • 2022-12-23
  • 2021-09-19
  • 2021-06-02
  • 2022-12-23
  • 2021-07-20
  • 2022-12-23
  • 2021-05-25
  • 2021-07-21
猜你喜欢
  • 2021-08-22
  • 2021-11-29
  • 2022-01-20
  • 2022-12-23
  • 2022-12-23
  • 2021-08-17
相关资源
相似解决方案