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 |
|
AskSQLTeam
Ask SQLTeam Question
0 Posts |
Posted - 2006-04-17 : 10:38:53
|
| kittu writes "Hello, I am in a situation where I just want to query the results of the database that is related to three tables. I am giving the situation as follows:Table1: rid name details 1 test testdetails 2 two twodetails 3 three threedetailsTable2: cid rid 1 1 2 1 3 1 2 2 3 2 1 3Table3: cid cname 1 cone 2 ctwo 3 cthreeNow my requirement is I should get the result as follows:Results: rid name details cname 1 test testdetails cone,ctwo,cthree 2 two twodetails ctwo,cthree 3 three threedetails cone****Can you please tell me how to do that.The query which I am running is getting as followsselect a.rid,a.name,a.details,b.cname from table1 a,table3 b,table2 c where a.rid=c.rid and c.cid=b.cidResults: rid name details cname 1 test testdetails cone 1 test testdetails ctwo 1 test testdetails cthree 2 two twodetails ctwo 2 two twodetails cthree 3 three threedetails cone" |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
|
|
|
|
|