摘要: 1、如果只有一个字段数据重复 自关联,保留id最小的那一条,其它的都删除 DELETE t1 FROM user t1, user t2 WHERE t1.user_code = t2.user_code AND t1.id > t2.id; 2、如果是全部字段都相同 delete from use 阅读全文
posted @ 2022-07-01 09:51 唏嘘- 阅读(1050) 评论(0) 推荐(0) 编辑
摘要: 1093 - You can't specify target table 'table_name' for update in FROM clause;不能先select出同一表中的某些值,再update这个表(在同一语句中) 原语句: delete from i_user where b_cod 阅读全文
posted @ 2022-07-01 09:34 唏嘘- 阅读(27) 评论(0) 推荐(0) 编辑