yet another argument for sub-selects :)
Paul DuBois wrote:
>
> At 2:31 PM -0800 3/22/01, Daren Cotter wrote:
> >I have a table, which keeps track of member information (including which
> >member referred the member). To get a count of the # of referrals for member
> >25, my query is:
> >
> >SE
uBois [mailto:[EMAIL PROTECTED]]
Sent: Sunday, April 22, 2001 12:58 PM
To: Daren Cotter; [EMAIL PROTECTED]
Subject: Re: Referer Count
At 2:31 PM -0800 3/22/01, Daren Cotter wrote:
>I have a table, which keeps track of member information (including which
>member referred the member).
At 2:31 PM -0800 3/22/01, Daren Cotter wrote:
>I have a table, which keeps track of member information (including which
>member referred the member). To get a count of the # of referrals for member
>25, my query is:
>
>SELECT COUNT(*) FROM members WHERE ref1 = 25;
>
>To get a list of the top refer
why are you using distinct(ref1)?
also count(*) is ambiguous in this case. should be count(a.*).
you have a ref1 column in both tables, but you don't join them on it. that's
kind of confusing but won't cause the problem. member_id is the primary key
on the members table, right? Otherwise you co