Re: How to use DISTINCT for two attributes combined
Date: Mon, 28 Jul 2003 16:16:21 +0100
> I want to select the count of distinct tuples in a table for some query.
> select count(distinct A.a1, A.a2) from FirstRel A, SecondRel B where
> A.a3=B.b1 group by B.b2, B.b3
> (Suppose FirstRel.a1 and FirstRel.a2 is the primary key of FirstRel.)
> However, it is not recognized by sql server. Is there any way that I can
> the count of distinct tuples in A?
select count(*) from
select distinct A.a1, A.a2
from FirstRel A
) Received on Mon Jul 28 2003 - 17:16:21 CEST