Hi all,create table #temp( ID int,IntroducerID int)insert into #temp select 1,1 union allselect 2,1 union allselect 3,2 union allselect 4,2 union allselect 5,3 union allselect 6,3 union allselect 7,4 union allselect 8,4 union allselect 9,5 union allselect 10,5 SELECT * FROM #TEMPQuery need To select internal dependencies (like tree structure)Expected Output:IF IntroducerID=3 then Output should beID IntroducerID5 36 39 510 5IF IntroducerID=2 then Output should beID IntroducerID3 24 25 36 37 48 49 510 5IF IntroducerID=1 then Output should beID IntroducerID1 12 13 24 25 36 37 48 49 510 5
Please help me--Ranjit