如何为每个成员计算所有各自的朋友 [英] how to count all the respective friends for every member

查看:75
本文介绍了如何为每个成员计算所有各自的朋友的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在社交网络网站上.
如何为数据库中的每个成员计算所有各自的朋友,并在每个成员的自己的页面中将其显示为(20)?

I''m working on social netorking web site.
How to count all the respective friends for every member in database and show it in the own page for every member like (20)?

推荐答案

是否存在父子关系在数据库中.就像一个perticular id(需要其朋友计数的人的id)的第一级孩子一样.您可以在sql服务器中使用heirarchical with语句(如果您使用的是一个!!)..否则,您需要告诉他有关数据库结构的信息.
is there a parent child relationship in database. Like the first level child of a perticular id( id of the person whose friends count is needed). U can use the heirarchical with statement in sql server ( if u r using one !!).. if not then you need to tell mre about he database structure.


这篇关于如何为每个成员计算所有各自的朋友的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆