Re: Eliminate Duplicate rows from table
Posted in 1999
From: peddis@my-deja.com
>
>what is the best way to eliminate duplicate rows from a table in
>Informix 7.3. Table has 5 Million rows .
There are lots of ways, one way is to
UNLOAD TO x.unl
SELECT UNIQUE *
FROM x; -- then reload it
Or you can unload the table and use sort -u, or you can
SELECT UNIQUE *
FROM x
INTO TEMP x1;
Then (and this is the brave part)
DROP TABLE x;
CREATE TABLE x (blah, blah, blah);
INSERT INTO x SELECT * FROM x1;
Please note that the last method leaves you *extremely* vulnerable to a
server failure. Make sure you have valid backups...
HTH.
--
Bye now,
Obnoxio
"The one with the smartest marketing department wins"
______________________________________________________
Get Your Private, Free Email at http://www.hotmail.com