Subject | Re: [ib-support] COUNT DISTINCT on a composite key |
---|---|
Author | Helen Borrie |
Post date | 2003-05-02T00:12:23Z |
At 04:44 PM 1/05/2003 -0700, you wrote:
But Select count(*) is all you need. The PK is by definition unique. Your
table will have exactly as many rows as there are distinct occurrences of
the key elements.
heLen
>I was wondering how to perform a distinct count when my table has aAre you saying this doesn't work? If not, what's the exception?
>composite primary key. I naively thought something like this might work:
>
>SELECT COUNT( DISTINCT keyColumn1, keyColumn2 ) ....
But Select count(*) is all you need. The PK is by definition unique. Your
table will have exactly as many rows as there are distinct occurrences of
the key elements.
heLen