Subject Re: [firebird-support] removing duplicate records
Author alan davies
Hi Milan - yes it did help a lot. I had created a view with basically the
same settings, but your version is easier. There were still some duplicates
where the user needs to decide which is the correct record, but this code
identifies those duplicate records for processing.

select weigh_code, count(weigh_code)
from weighcopy
group by weigh_code
having count(weigh_code)>1

Thanks
Alan

At 23:10 29/06/2004, you wrote:

>alan davies wrote:
> > Can anyone help with removing a lot of duplicate records that have been
> > imported from an external system.
>
>Create some temporary table with same structure, and do
>
>insert into temporary_table
>select distinct col1, col2, col3, ...etc
>from table_with_duplicates;
>
>Then just empty the original table, and import the records back:
>
>delete from table_with_duplicates;
>
>insert into table_with_duplicates
>select * from temporary_table;
>
>HTH
>
>--
>Milan Babuskov
>http://fbexport.sourceforge.net
>
>
>
>
>
>Yahoo! Groups Links
>
>
>
>
>
>
>
>
>
>
>--
>Incoming mail is certified Virus Free.
>Checked by AVG Anti-Virus (http://www.grisoft.com).
>Version: 7.0.253 / Virus Database: 263.3.7 - Release Date: 27/06/2004

Alan J Davies
Aldis
Tel: +44(0)1926 842069
Fax: +44(0)1926 843755


--
Outgoing mail is certified Virus Free.
Checked by AVG Anti-Virus (http://www.grisoft.com).
Version: 7.0.253 / Virus Database: 263.3.7 - Release Date: 27/06/2004