방법1.
create table emp2 as select distinct * from emp;
drop table emp;
rename emp2 to emp;
방법2. //자료가 많을땐 시간이 좀걸리죠.
delete from emp a
where rowid > (select min(rowid) from emp b
where b.empno = a.empno);
방법3 //가장 좋은 방법이다.
delete from emp a, emp b
where a.rowid <> b.rowid
and a.empno = b.empno;
create table emp2 as select distinct * from emp;
drop table emp;
rename emp2 to emp;
방법2. //자료가 많을땐 시간이 좀걸리죠.
delete from emp a
where rowid > (select min(rowid) from emp b
where b.empno = a.empno);
방법3 //가장 좋은 방법이다.
delete from emp a, emp b
where a.rowid <> b.rowid
and a.empno = b.empno;
| 12-27 | 2505 | |||
| 12-11 | 1844 | |||
| 53 | 03-15 | 1649 | ||
| 52 | 01-31 | 1737 | ||
| 51 | 01-31 | 2509 | ||
| 50 | 01-31 | 1386 | ||
| 49 | 01-19 | 1685 | ||
| 48 | 01-11 | 1569 | ||
| 47 | 01-03 | 2072 | ||
| 46 | 12-27 | 2505 | ||
| 45 | 12-19 | 1802 | ||
| 44 | 12-14 | 1776 | ||
| 43 | 12-11 | 1844 | ||
| 42 | 12-09 | 1443 | ||
| 41 | 12-01 | 1669 | ||
| 40 | 12-01 | 1842 | ||
| 39 | 12-01 | 1315 | ||
댓글 없음:
댓글 쓰기