Hi all,
I am pulling my hair out here! I am trying to select all the children records from the following data (i.e. I need to return all of the data you see below.)
The only 'where clause' data is have is WHERE ID = 37
I have been trying to do a recursive query .... with no luck.
This query i need would have been done a million times (i.e. getting all the messages under a thread on a forum), however I am strugging.
Thanks for any tips or suggestions or queries!!
Matt
kloner
I am pulling my hair out here! I am trying to select all the children records from the following data (i.e. I need to return all of the data you see below.)
The only 'where clause' data is have is WHERE ID = 37
Code:
[ID] [ParentID] [Title]
37 1 BIG GIG
38 37 2004 News and Information
39 37 Merchandise
40 37 Previous Events
45 40 2003 - Wembley Arena, London
I have been trying to do a recursive query .... with no luck.
Code:
SELECT M2.*
FROM TBL_SectionsTree AS M1
JOIN TBL_SectionsTree AS M2
ON M1.SectionID = M2.ParentID
WHERE
M1.Sectionid = 37 or M1.ParentID = M1.SectionID
This query i need would have been done a million times (i.e. getting all the messages under a thread on a forum), however I am strugging.
Thanks for any tips or suggestions or queries!!
Matt
kloner