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.
| Author |
Topic |
|
chava_sree
Yak Posting Veteran
56 Posts |
Posted - 2008-06-05 : 19:53:21
|
| Hi allI've two tables community, community_related.I need to get community names for comm_relatedID from community tablewhere comm_id = 21 , please see my tables belowCommunity table Community RelatedcommID, comm_name comm_id comm_relatedID 21 test1 21 24 22 test2 21 2223 test3 21 26 24 test 5 21 27 26 test627 test7result am trying to display from community related table after joining community table on COMM_ID = 21 iscomm_id comm_relatedID comm_name21 24 test521 22 test221 26 test621 27 test7can anybody please help..with a query, am stuck at this point. |
|
|
sodeep
Master Smack Fu Yak Hacker
7174 Posts |
Posted - 2008-06-05 : 21:35:24
|
| Try this:select b.comm_id ,b.comm_relatedID ,a.comm_name from dbo.Community Related bleft join dbo.Community aon b.comm_relatedID = a.commID |
 |
|
|
|
|
|