删除一个信息表中除id外其他字段都相同的冗余信息,如下

id name addr

1  a   b

2  a   b

3  b   c

删除这个表中的冗余信息

即应该是

id name addr

1  a   b

3  b   c

设table为t

 

--Sql:
delete from tableName where id not in (select min(id) from tableName group by name, addr…)

相关文章:

  • 2022-12-23
  • 2021-07-24
  • 2022-02-16
  • 2022-12-23
  • 2021-06-29
  • 2021-12-30
  • 2021-05-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-02-02
  • 2022-12-23
  • 2021-07-02
  • 2022-12-23
  • 2021-04-08
  • 2021-06-28
相关资源
相似解决方案