Re: sql question
Posted in 1997
Topics: General Discussion
In article <348B572B.1D63@netvision.net.il>,
ministry of education <moe003@netvision.net.il> wrote:
}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.
Well, pretty much the same suggestion as others...
pseudo-code as follows:
backup database
create temporary_table identical structure as table_in_question
insert into temporary_table
select distinct * from table_in_question
delete from table_in_question
insert into table_in_question
select * from temporary_table
drop table temporary_table
--
+-----------------------------------------------------------------+
| 'The Fourth Crusade' is registered with Corporation Division |
+- - - - - - - - - - - + Business Registry, state of Oregon, USA |
| mmcdaniel@acm.org +- - - - - - - - - - - - - - - - - - - - - +
| IEEE \\ WarpSRVR, DB2 | IBM Premier Business Partner |
| ACM \\ Certified | |
+----------------------+------------------------------------------+