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.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 = 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.c
om...
> 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.
>
No comments:
Post a Comment