SQL删除语句的应用

2026-05-15 13:42:45

1、一、只要bz字段不是NULL,就删除对应的、所有的sfzhm的记录

SQL删除语句的应用

2、二、删除重复记录,只保留ID最大的记录

delete from 表名 where id not in(select max(id) from 表名 group by sfzhm)

相关推荐
  • 阅读量:70
  • 阅读量:183
  • 阅读量:136
  • 阅读量:62
  • 阅读量:179
  • 猜你喜欢