Subject Re: [firebird-support] How to find duplicate rows when creating a unique index?
Author Kjell Rilbe
Matthias Hanft wrote:
> Dimitry Sibiryakov schrieb:
> >
> > select blz, konto, auszugrn, neugutdatum, count(*) from auszuege
> > group by blz, konto, auszugrn, neugutdatum
> > having count(*)>1
>
> Oh, "having" was the magic word I was trying to find - thank you
> very much! I already knew that it exists, but I guess I had used
> it just 2 or 3 times within the last 20 years... :-) (never needed
> it apparently - until now)

Depending on your details you may also want to try something like

select *
from AUSZUEGE A
where exists (
select 1
from AUSZUEGE ASUB
where 'compare all key fields for equality
and 'compare some or all other field(s)
'that is sure to diff between
'duplicates for inequality
)

Kjell
--
------------------------------
Kjell Rilbe
DataDIA AB
E-post: kjell.rilbe@...
Telefon: 08-761 06 55
Mobil: 0733-44 24 64


[Non-text portions of this message have been removed]