285 1
285 2
285 3
Member 285 has 3 friends. Table is set out as above.
Members 1,2 and 3 have their own friends.
MEMBER_ID FRIEND_ID
1 286
1 1654
1 556
2 56465
2 87864
3 564564
3 5454
3 4588
3 4545
So from the above we can see that the Friends of Friends count would be
9.
Using the above how could I write a query that gave me the answer 9 for
the member_id 285?
I thank clever person who can help.This is a multi-part message in MIME format.
--=_NextPart_000_0A1D_01C6D648.8662A940
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
It's not really clear what you are trying to accomplish here, but for a ='wag':
SELECT count(1)
FROM Table1 t1
JOIN Table2 t2
ON t1.Friend_ID =3D t2.Member_ID
-- Arnie Rowland, Ph.D.
Westwood Consulting, Inc
Most good judgment comes from experience. Most experience comes from bad judgment. - Anonymous
<gurdipv@.gmail.com> wrote in message =news:1158075642.788596.64550@.e63g2000cwd.googlegroups.com...
> MEMBER_ID FRIEND_ID
> 285 1
> 285 2
> 285 3
> > Member 285 has 3 friends. Table is set out as above.
> > Members 1,2 and 3 have their own friends.
> > MEMBER_ID FRIEND_ID
> 1 286
> 1 1654
> 1 556
> 2 56465
> 2 87864
> 3 564564
> 3 5454
> 3 4588
> 3 4545
> > > So from the above we can see that the Friends of Friends count would =be
> 9.
> > Using the above how could I write a query that gave me the answer 9 =for
> the member_id 285?
> > I thank clever person who can help.
>
--=_NextPart_000_0A1D_01C6D648.8662A940
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
&
It's not really clear what you are =trying to accomplish here, but for a 'wag':
SELECT count(1)
FROM Table1 t1
JOIN Table2 =t2
=ON t1.Friend_ID =3D t2.Member_ID
-- Arnie Rowland, Ph.D.Westwood Consulting, Inc
Most good judgment comes from =experience. Most experience comes from bad judgment. - Anonymous
--=_NextPart_000_0A1D_01C6D648.8662A940--
No comments:
Post a Comment