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

  1. Path: sparky!uunet!mcsun!uknet!mucs!rick!rick
  2. From: rick@rick.cs.man.ac.uk (Rick Dipper)
  3. Newsgroups: comp.databases.oracle
  4. Subject: Re: Deleting Duplicates
  5. Message-ID: <5483@m1.cs.man.ac.uk>
  6. Date: 27 Jul 92 14:42:28 GMT
  7. References: <VN70NB1w165w@iowegia.uucp> <1992Jul23.091611.1@jaguar.uofs.edu>
  8. Sender: news@cs.man.ac.uk
  9. Reply-To: rick@uk.ac.man.cs
  10. Organization: University of Manchester, Dept. Computer Science
  11. Lines: 30
  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. |> 
  18. |> I'm relatively new at the job, but I suspect you could create a similar
  19. |> table, do an INSERT SELECT UNIQUE from the old table to the new table,
  20. |> delete all rows from the old table, copy all rows from the new table
  21. |> to the old, and then drop the new one.  Maybe there's a better way.
  22. |> 
  23. |> Good Luck.
  24. |> 
  25. |> --
  26. |> Chris Little, Programmer/DBA
  27. |>                                                 University Computing Systems
  28. |>                                                 University of Scranton
  29. |>   LITTLEC1@JAGUAR.UOFS.EDU                      Scranton, PA 18510
  30.  
  31. My first guess, but it can fail.
  32.     you need to do "create table <b> as select distince from <a>;"
  33.                "delete * from <a>;"
  34.                "insert into <a> select * from <a>;"
  35.  
  36. or use one of the row deleting queies in one of the messages of this newsgroup.
  37.  
  38.  
  39. -- 
  40. RICK DIPPER, Unix Systems Administrator                       rick@uk.ac.man.cs
  41. Department of Computer Science, University of Manchester           061-275-5725
  42. .............................Meemberrr the of Fumblee Ingers Culb..............
  43.