March 18, 2004 at 9:02 am
Hi All,
I am having two tables as follows:
ModuleTypes (ModuleTypeID, ModuleType)
ModuleSections (ModSecID, ModSecName, ModuleTypeID, ParentID)
Relation between the two tables -> ModuleTypeID
Self relation for ModuleSections ie., ModSecId = ParentID
Sample Data
ModuleTypeID ModuleType
1 Normal
2 Keyboard
3 Listening
ModSecID ModSecName ModuleTypeID ParentID
1 N1 1 0
2 N2 1 1
3 N3 1 1
4 N4 1 2
5 N5 1 4
6 N6 1 5
Now i want to write a query so that my data will be like
1 N1 Null
2 N2 N1
3 N3 N1
4 N4 N1 (Parentid = 2, which has parentid = 1)
5 N5 N1 (Parentid = 4, which has parentid = 2 in turn parentid = 1)
6 N6 N1 (Parentid = 5, which has parentid = 4 in turn parentid = 1)
Can anyone shed some light and help me to frame the query?
Thanks in advance.
Lucky
Viewing 2 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply