If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > Subquery/Join query

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 06-21-11, 03:02
sandeepck sandeepck is offline
Registered User
 
Join Date: Feb 2011
Posts: 3
Subquery/Join query

I have a table User consits of User details, Network_Network has the community information, Network_Subscribed_Networks has the User list who are subscribed to the Network.

Now i want to display the list of Users who have subscribed and is the owner of the network where Network_id=10;

The below query gives me only the owner name for nn.id=10; where as i want owner name and another users list who belong to nn.id=10.

Hope i am clear with the question. Can anybody please help me.

select user1.userid
from user user1
inner join (network_subscribed_networks nsn left outer join network_network nn on nsn.user_id = nn.created_by)
on user1.userid = nn.created_by
where nn.id = 10
group by nn.created_by
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On