Subject Re: [firebird-support] Re: Getting duplicate records in a table
Author Ann W. Harrison
Adam wrote:

>>>
>>>select FieldA, FieldB
>>>from TableA
>>>group by 1,2
>>>having count(*)>1
>>>

> ...so perhaps I have an irrational
> phobia of count(*) ;)
>

In this case, the item to fear is the grouping of
an unqualified table, not the count(*). Since the
count is in the having clause, it applies only to
the set of record in the group - which is cheap
since you're counting them as you retrieve them.
Grouping, on the other hand, reads and sorts the
whole table.

Regards,


Ann