Subject | Re: [firebird-support] finding triple entries |
---|---|
Author | Alan J Davies |
Post date | 2010-09-10T10:28:26Z |
On 10/09/2010 11:10, Christian Waldmann wrote:
select a_unique_reference,visitid, count(visitid) as DUPLICATES
from yourtablename
group by a_unique_reference,visitid
having count(visitid)>2
a_unique_reference will be some field you can easily identify, such as
person's name or account id.
--
Alan J Davies
Aldis
> Hello SQL expertsTry this:
>
> I have a table with a colum visitId ( and some other culoms)
>
> Each visitiId is exactly twice in the tabel. By error there are some
> visitId more than twice in the table.
>
> Who knows an efficent query to find all rows where the visitid is
> present more than two times?
>
> many thanks
> Christian
select a_unique_reference,visitid, count(visitid) as DUPLICATES
from yourtablename
group by a_unique_reference,visitid
having count(visitid)>2
a_unique_reference will be some field you can easily identify, such as
person's name or account id.
--
Alan J Davies
Aldis