Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Duplicate ids
Message
De
29/06/2001 10:20:30
 
 
À
28/06/2001 08:34:38
Christian Cote
Les Logiciels Onoma Inc.
Longueuil, Québec, Canada
Information générale
Forum:
Visual FoxPro
Catégorie:
Client/serveur
Titre:
Divers
Thread ID:
00524612
Message ID:
00525183
Vues:
23
You can use SQL Plus:

Option 1) The simplest and most elegant Method

CREATE TABLE table_without_duplicates AS
SELECT DISTINCT *
FROM table_with_duplicates ;
COMMIT;

DROP TABLE table_with_duplicates ;
COMMIT;
RENAME TABLE table_without_duplicates table_with_duplicates;

Option 2) An Oracle-specific Method
For Oracle, this solution utilizes the unique rowid of each row in a table,
and removes all duplicate rows in a table:

DELETE FROM my_table t
WHERE EXISTS (
SELECT *
FROM my_table tt
WHERE t.rowid > tt.rowid
AND other criteria)

The rowid > part makes sure you take the first of the rows in the duplicate set...

HTH
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform