Salute..I have the following two tablesSectionsTable----------------SectionId ParentSectionId SectionName--------- --------------- -----------1 0 Aaa2 1 X3 1 Y4 0 Bbb5 4 G6 4 HAndAccountTable---------------TransId SectionId AccountNo-------- --------- ---------1 2 62 2 73 3 84 3 9
Now..How can I write the SELECT statement that selects the sections and the accountno that belong to them....for exampleSectionId AccountNo--------- ---------1 6 (becasue section 1 is the parent of section 2 and 3)1 7 (becasue section 1 is the parent of section 2 and 3)1 8 (becasue section 1 is the parent of section 2 and 3)1 9 (becasue section 1 is the parent of section 2 and 3)2 62 73 83 9etc.....
Thanks ALOT