问题描述

最近搜索关键词,去除重复

解决方案

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
-- 使用rowid标识解决重复问题
DELETE FROM your_table
WHERE rowid not in
(SELECT MIN(rowid)
FROM your_table
GROUP BY column1, column2, column3);

-- method1
DELETE from table_name where rowid not in (select min(rowid) FROM table_name group by column_name);

-- method2
DELETE from table_name a where rowid > (select min(rowid) FROM table_name b where a.column=b.column);

参考链接

Removing duplicate rows from table in Oracle