Re: sql question
Posted in 1997
Try this:
- select distinct col1, col2 .... , count(*)
from table
group by col1, col2 ....
having count(*) > 1
into temp temp_dulicates;
- delete from table
where col1||col2 .... in
(select col1||col2 ....
from temp_duplicates);
- insert into table
select col1, col2 .... from temp_duplicates;
Warning TEST this before running!
Regards
David Ashby
______________________________ Reply Separator _________________________________
Subject: sql question
Author: ministry of education <moe003@netvision.net.il> at WCA-INET
Date: 07/12/97 6:10 PM
I have a table with multiple exact duplicate rows.No indexes. How do I
delete all duplicate rows to get a single occurrence for each row?
Thanx.