Re: SQL -- question ...

From: Carl Gohringer <cgohring_at_lucifer>
Date: 1995/04/05
Message-ID: <D6K7wA.1sM_at_nl.oracle.com>#1/1


Assuming that PK is the name of the column that is the Primary Key for the table(modify appropriatelly if your primary key is multiple concatonated columns):

delete from <table> X
where rowid < (select max(rowid) from table

                where X.PK = <table>.PK)


nik127_at_unm.edu (peter nichola draper) writes:
: Newsgroups: comp.databases.oracle
: Subject: SQL --- Question ???
: Summary:
: Expires:
: Sender: nik127_at_unm.edu
: Followup-To:
: Distribution: comp.databases.oracle
: Organization: University of New Mexico, Albuquerque
: Keywords:
: Cc: nik127_at_unm.edu
:
: Hello,
: Hope someone out there can help me with I hope a quickie
: answer.
: I'm looking for an sql script that deletes duplicate rows.
: Criteria: No unions allowed the table has Megs of data.
: Rows may have all the same fields in them.
:
: for example
:
:
: table duprows (time number, val1 number, val2 number)
:
: with the values
: TIME VAL1 VAL2
: ---------- ---------- ----------
: 6353902.24 1 2
: 6353902.24 2 2
: 6353902.26 3 3
: 6353902.27 9 9
: 6353902.27 9 9
:
:
: new table should be
:
: 6353902.24 1 2
: 6353902.26 3 3
: 6353902.27 9 9
:
: if the time field is duplicated I only want one entry.
: doesn't matter which one ....
:
:
: Thanks in advance
:
:
: Lizz Draper
:
:
:

--
regards,
Carl
+-----------------------------------------------------------------------------+
Carl Gohringer, Oracle European Development Centre, World Wide Education 
Oracle Park, Bittams Lane, Chertsey, Surrey, England, KT16 9RG
Internet   : cgohring_at_uk.oracle.com    
+-----------------------------------------------------------------------------+
Received on Wed Apr 05 1995 - 00:00:00 CEST

Original text of this message