Subject | Re: [firebird-support] Re: Getting duplicate records in a table |
---|---|
Author | Ann W. Harrison |
Post date | 2006-04-27T13:45:52Z |
Adam wrote:
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
>>>In this case, the item to fear is the grouping of
>>>select FieldA, FieldB
>>>from TableA
>>>group by 1,2
>>>having count(*)>1
>>>
> ...so perhaps I have an irrational
> phobia of count(*) ;)
>
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