query to find list of max. members?
Posted: Fri Nov 06, 2009 5:02 am
Hi,
I have 3 tables which is as follow
1)User with column names
User_Id
User_Name
2)group with column names
group_id
group_name
creator(which is foreign key to User_Id )
3)group_member with column names
member_id
group_id
member_name
I want to type query to find list of groups having maximum no of groupmember.
means
if group1 has 6 members,group2 has 8 members,group3 has 11 members and group4 has 3 members
then result will be like this:
Groupname membercount
group3 11
group2 8
group1 6
group4 3
Please help me
Thanks in advance.
I have 3 tables which is as follow
1)User with column names
User_Id
User_Name
2)group with column names
group_id
group_name
creator(which is foreign key to User_Id )
3)group_member with column names
member_id
group_id
member_name
I want to type query to find list of groups having maximum no of groupmember.
means
if group1 has 6 members,group2 has 8 members,group3 has 11 members and group4 has 3 members
then result will be like this:
Groupname membercount
group3 11
group2 8
group1 6
group4 3
Please help me
Thanks in advance.