Re: sql question
From: Nigel Gall <nigelg_at_ppsl.com>
Date: 1997/12/08
Message-ID: <66h49i$ae_at_cssun.mathcs.emory.edu>#1/1
Date: 1997/12/08
Message-ID: <66h49i$ae_at_cssun.mathcs.emory.edu>#1/1
Hi!
I've been watching all the responses to this, which advise selecting unique, count(*) into temp, then deleting with a subselect, and re-inserting from temp.
Why can't we, to make the process simple, just:
Unload all rows to a file (serves as backup if you make a mess):
unload to "dupl_rows.unl"
select * from mytable
order by 1, 2, 3, 4, 5, ..., n {where n = number of columns in mytable}
Run unix uniq command on file dupl_rows.unl: $ uniq dupl_rows.unl > unique_rows.unl
Then delete all rows from mytable:
delete from mytable
Then reload from unique_rows.unl:
load from "unique_rows.unl"
insert into mytable
Any views?
Best regards,
Nigel
+-------------------------------------------------------------++----- mailto:nigelg_at_ppsl.com ------ http://www.ppsl.com -----+ Received on Mon Dec 08 1997 - 00:00:00 CET
|Name : Edmund Nigel Gall Tel: (868) 636 3153 |
|Title : Information Systems Specialist Fax: (868) 679 3770 |
|Company: Process Plant Services Limited |
|Address: Atlantic Avenue, Point Lisas Industrial Estate |
| Point Lisas, Couva, Trinidad & Tobago, W.I. |