|
-
Feb 20th, 2006, 12:46 PM
#1
Thread Starter
Lively Member
[RESOLVED] One to Many SQL statement (subquery)
I would like to get the name of each buddy I have listed in my tblBuddies table from a subquery.
Select userName From tblIMUser where userID = (Select distinct userbuddy From tblBuddies Where userID = 4)
From this I get a subquery error Any ideas on how to get around this I was thinking of a for Each Loop in the SQL
what do you think
tblIMUser
userID (PK) userName
----------------------
1 Name1
2 Name 2
3 Name 3
tblBuddies
UserID BuddyID
----------------------
1 - 2
1 - 3
3 - 1
3 - 2
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|