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 |
|
vijaydaniel.j
Starting Member
2 Posts |
Posted - 2009-11-11 : 01:04:32
|
| Hi all..I would like to have a self join for the table..intRecID intTopicID vchData 2 0 3B3 0 4A 4 0 4B5 2 Belongs to 3B6 2 Belongs to 3B7 3 Belongs to 4A8 3 Belongs to 4A9 3 Belongs to 4B10 3 Belongs to 4BFrom the above table i would like to have the output as..vchData1 vchData23B Belongs to 3B3B Belongs to 3B4A Belongs to 4A4A Belongs to 4A4B Belongs to 4B4B Belongs to 4BI tried Self joining the table but i couldnt get the above output..Please help..Thanks in advance..Regards.,Vijay |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2009-11-11 : 01:07:59
|
[code]select a.vchData, b.vchData from table1 a inner join table1 b on a.intRecID = b.intTopicID[/code] KH[spoiler]Time is always against us[/spoiler] |
 |
|
|
vijaydaniel.j
Starting Member
2 Posts |
Posted - 2009-11-11 : 03:25:14
|
quote: Originally posted by khtan
select a.vchData, b.vchData from table1 a inner join table1 b on a.intRecID = b.intTopicID KH[spoiler]Time is always against us[/spoiler]
great.. it worked.. thanks a lot |
 |
|
|
|
|
|