Subject Re: SQL query
Author Peter Miglinski
--- In ib-support@yahoogroups.com, Svein Erling Tysvaer
<svein.erling.tysvaer@k...> wrote:
> ....
>
> INSERT INTO NewTable
> SELECT * FROM OldTable
>
> That should prevent duplicate values from being assigned (of
course, you do
> not know which of the duplicate records are inserted).

I think exception is raised in such situation, so none of records are
copied.

You can try sg like this if exec time is not critical:

select (or delete) from MyTable t1
where not singular(select * from MyTable t2
where t2.KeyValue=t1.KeyValue)

or maybe

select (or delete) from MyTable T1
where exists(select 'a' from MyTable T2 where T2.NewKey=T1.NewKey
and T2.PrimKey>T1.PrimKey)

Good Luck