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

  1. Path: sparky!uunet!psinntp!vitro.com!v7.vitro.com!fams09
  2. From: fams09@v7.vitro.com
  3. Newsgroups: comp.databases.oracle
  4. Subject: Re: Deleting Duplicates
  5. Message-ID: <1992Jul24.085912.205@v7.vitro.com>
  6. Date: 24 Jul 92 08:59:12 -0500
  7. References: <VN70NB1w165w@iowegia.uucp> <1992Jul23.091611.1@jaguar.uofs.edu>
  8. Summary: duh
  9. Keywords: dhooh
  10. Organization: Vitro Corporation
  11. Lines: 29
  12.  
  13. In article <1992Jul23.091611.1@jaguar.uofs.edu>, littlec1@jaguar.uofs.edu (Chris Little) writes:
  14. > In article <VN70NB1w165w@iowegia.uucp>, bob@iowegia.uucp (Bob Powers) writes:
  15. >> How can I delete duplicate rows in a table using SQL*PLUS.  This is
  16. >> an unindexed table and I would like to keep it that way.
  17. > I'm relatively new at the job, but I suspect you could create a similar
  18. > table, do an INSERT SELECT UNIQUE from the old table to the new table,
  19. > delete all rows from the old table, copy all rows from the new table
  20. > to the old, and then drop the new one.  Maybe there's a better way.
  21. > Good Luck.
  22. > --
  23. > Chris Little, Programmer/DBA
  24. 1)
  25. select...
  26. from abc
  27. for update of..
  28.  
  29.  
  30. 2) delete from abc y
  31.    where rowid > (select min(rowid)
  32.                   from abc x
  33.                   where y.key_col = x.key_col)
  34. /
  35.  
  36.  
  37.                   
  38.  
  39.