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 |
|
vijayanto
Starting Member
16 Posts |
Posted - 2009-06-23 : 06:11:23
|
| hi friends,i have trouble while making sql queryi have created table with two fields that is Father field and Child field but in the Child field may have another Child datas so i want to display the datas in father with child datas and also must display the child datas for the Child fieldplease give me a solutionregards vijay |
|
|
senthil_nagore
Master Smack Fu Yak Hacker
1007 Posts |
Posted - 2009-06-23 : 06:32:47
|
| Will you update your table structure and expected result?Senthil.C------------------------------------------------------[Microsoft][ODBC SQL Server Driver]Operation canceled |
 |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2009-06-23 : 06:52:27
|
Read the excellent Microsoft SQL Server help file, called Books Online, for "recursive CTE". E 12°55'05.63"N 56°04'39.26" |
 |
|
|
Lumbago
Norsk Yak Master
3271 Posts |
Posted - 2009-06-23 : 07:04:44
|
Or (depending on requirements) create a simple self join...?SELECT * FROM table1 father INNER JOIN table1 child on child.FatherID = father.IDWHERE father.FatherID IS NULL - Lumbago |
 |
|
|
|
|
|