home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!mcsun!uknet!mucs!rick!rick
- From: rick@rick.cs.man.ac.uk (Rick Dipper)
- Newsgroups: comp.databases.oracle
- Subject: Re: Deleting Duplicates
- Message-ID: <5483@m1.cs.man.ac.uk>
- Date: 27 Jul 92 14:42:28 GMT
- References: <VN70NB1w165w@iowegia.uucp> <1992Jul23.091611.1@jaguar.uofs.edu>
- Sender: news@cs.man.ac.uk
- Reply-To: rick@uk.ac.man.cs
- Organization: University of Manchester, Dept. Computer Science
- Lines: 30
-
- In article <1992Jul23.091611.1@jaguar.uofs.edu>, littlec1@jaguar.uofs.edu (Chris Little) writes:
- |> In article <VN70NB1w165w@iowegia.uucp>, bob@iowegia.uucp (Bob Powers) writes:
- |> > How can I delete duplicate rows in a table using SQL*PLUS. This is
- |> > an unindexed table and I would like to keep it that way.
- |>
- |> I'm relatively new at the job, but I suspect you could create a similar
- |> table, do an INSERT SELECT UNIQUE from the old table to the new table,
- |> delete all rows from the old table, copy all rows from the new table
- |> to the old, and then drop the new one. Maybe there's a better way.
- |>
- |> Good Luck.
- |>
- |> --
- |> Chris Little, Programmer/DBA
- |> University Computing Systems
- |> University of Scranton
- |> LITTLEC1@JAGUAR.UOFS.EDU Scranton, PA 18510
-
- My first guess, but it can fail.
- you need to do "create table <b> as select distince from <a>;"
- "delete * from <a>;"
- "insert into <a> select * from <a>;"
-
- or use one of the row deleting queies in one of the messages of this newsgroup.
-
-
- --
- RICK DIPPER, Unix Systems Administrator rick@uk.ac.man.cs
- Department of Computer Science, University of Manchester 061-275-5725
- .............................Meemberrr the of Fumblee Ingers Culb..............
-