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
 SQL Server 2000 Forums
 Transact-SQL (2000)
 Use a Join?

Author  Topic 

mike123
Master Smack Fu Yak Hacker

1462 Posts

Posted - 2002-02-04 : 02:40:26

Ok I have never written a query like this before maybe somebody can help me out. I'll explain this best I can

Information I have: from tblUserDetails I have the field "NAMEONLINE"

Information I need:

from FORUM_TOPICS I need all the data in these row however "NAMEONLINE" is not in here and I need a corresponding WHERE clause on "USERID"


From FORUM_MEMBERS I can get the "USERID" that corresponds with the "NAMEONLINE", therefor allowing me to do the select on "FORUM_TOPICS"

you might have to read that one twice :)



Nazim
A custom title

1408 Posts

Posted - 2002-02-04 : 02:54:12
i have read it 4 times. but couldnt get much of it.

From whatever i could grasp

select * from tblUserdetails t
left join Forum_members fm
on t.Nameonline=fm.userid
left join forum_topics ft
on fm.commonkeywithforumotopic=ft.commonkeywithforummembers --change this with the primary and referential key in both tables.

HTH

--------------------------------------------------------------
Dont Tell God how big your Problem is , Tell the Problem how Big your God is

Edited by - Nazim on 02/04/2002 03:18:28
Go to Top of Page

mike123
Master Smack Fu Yak Hacker

1462 Posts

Posted - 2002-02-04 : 03:08:47

you got it all !

thanks again nazim



Go to Top of Page
   

- Advertisement -