home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / database / oracle / 1101 < prev    next >
Encoding:
Internet Message Format  |  1992-07-22  |  1.1 KB

  1. Path: sparky!uunet!oracle!unrepliable!bounce
  2. Newsgroups: comp.databases.oracle
  3. From: kjou@us.oracle.com (Kathy Jou)
  4. Subject: Re: Deleting Duplicates
  5. Message-ID: <1992Jul22.180057.24140@oracle.us.oracle.com>
  6. Followup-To: kjou@oracle.com
  7. Sender: Kathy Jou
  8. Nntp-Posting-Host: hqpyr1.us.oracle.com
  9. Organization: Oracle Corporation, Redwood Shores CA 94065
  10. References: <VN70NB1w165w@iowegia.uucp>
  11. Date: Wed, 22 Jul 1992 18:00:57 GMT
  12. X-Disclaimer: This message was written by an unauthenticated user
  13.               at Oracle Corporation.  The opinions expressed are those
  14.               of the user and not necessarily those of Oracle.
  15. Lines: 16
  16.  
  17. In article <VN70NB1w165w@iowegia.uucp> bob@iowegia.uucp (Bob Powers) writes:
  18. >How can I delete duplicate rows in a table using SQL*PLUS.  This is
  19. >an unindexed table and I would like to keep it that way.
  20.  
  21. delete from table_name
  22. where rowid = any (select rowid from table_name
  23.            minus
  24.            select min(rowid) from table_name
  25.            group by column_name);
  26.  
  27. Column_name should be the primary key of the table.
  28.  
  29.  
  30. Kathy Jou
  31. Oracle Corporation
  32.  
  33.