如何删除表中相同字段值的记录(比如相同的EMPNO,假设没有主键)
方法1
DELETE FROM EMP WHERE ROWID NOT IN(SELECT MAX(ROWID) FROM EMP GROUP BY EMPNO);
方法2
DELETE FROM emp e WHERE ROWID NOT IN ( SELECT MIN(ROWID) FROM emp a WHERE e.empno=a.empno);
方法3
DELETE FROM table_name A WHERE ROWID > ( SELECT min(ROWID) FROM table_name B WHERE A.col = B.col);