Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Help with multiple table joins (count)

Author  Topic 

shawnmolloy
Yak Posting Veteran

93 Posts

Posted - 2008-09-17 : 01:42:11
Hi,

Please help me get the count of total "subscribers" by the user id.

Table: Video_Channel_Subscriber
- ChannelID (FK)

Table: Video_Channel
- ChannelID (PK)

Table: Video_Channel_Video (look up table)
- ChannelID (FK)
- UserID (int)

I need to find the count of subscribers (in Video_Channel_Subscriber) by the user id column in Video_Channel_Video.

One user can have multiple video_channels, so I need to find all the Video_Channel_Subscribers for all the channels in Video_Channel_Video by a certain userid.

I hope this makes sense... I'm really having a problem getting my head around this problem!

Thank you.

--shawn

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2008-09-17 : 01:48:57
quote:
Please help me get the count of total "subscribers" by the user id.

select count(distinct UserID) from Video_Channel_Video



KH
[spoiler]Time is always against us[/spoiler]

Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-09-17 : 01:59:59
whats the field containing subscriber info?
Go to Top of Page
   

- Advertisement -