标签:src 数据 arc drop val select dynamic ima code
-- 建表
DROP TABLE IF EXISTS `table1`;
CREATE TABLE `table1` (
`id` int(11) NULL DEFAULT NULL,
`name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic;
INSERT INTO `table1` VALUES (2, ‘B‘);
INSERT INTO `table1` VALUES (3, ‘C‘);
INSERT INTO `table1` VALUES (4, ‘D‘);
INSERT INTO `table1` VALUES (5, ‘E‘);
INSERT INTO `table1` VALUES (1, ‘A‘);
INSERT INTO `table1` VALUES (1, ‘A‘);
-- 查询
--删除,结果
delete from table1 where name in (
SELECT * from (
SELECT name from table1 GROUP BY name having COUNT(id)>1)a
)
标签:src 数据 arc drop val select dynamic ima code
原文地址:https://www.cnblogs.com/liyunchuan/p/12594146.html