Re: How to use DISTINCT for two attributes combined

From: Xiaoxin Yin <xyin1_at_uiuc.edu>
Date: Mon, 28 Jul 2003 21:47:11 -0500
Message-ID: <CblVa.4446$o7.56382_at_vixen.cso.uiuc.edu>


Thank every one for helping. I have solved the problem :)

Xiaoxin

"programmer" <int.consultNOCAPITALS_at_macmail.com> wrote in message news:bg3f7b$skl$1_at_pheidippides.axion.bt.co.uk...
> > I want to select the count of distinct tuples in a table for some query.
> For
> > example,
> > 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
> get
> > the count of distinct tuples in A?
>
>
> select count(*) from
> (
> select distinct A.a1, A.a2
> from FirstRel A
> )
>
>
>
Received on Tue Jul 29 2003 - 04:47:11 CEST

Original text of this message