博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

删除重复列

Posted on 2012-07-24 18:02  紫冰龙  阅读(128)  评论(0编辑  收藏  举报
DELETE FROM abc
      WHERE ROWID IN (SELECT r
                        FROM (SELECT t.ROWID r,
                                     ROW_NUMBER( )
                                     OVER ( PARTITION BY empno, ename, job
                                            ORDER BY empno, ename, job )
                                        id
                                FROM abc t)
                       WHERE id <> 1);


create   table abc2  as select empno,ename,job from abc group by empno,ename,job;