Chaitanya V
asked on
Sql server Getting all questions under a technology and its child (n-level)
I am having a technology table where I am having data as follows
My Question table is as follows
What I am trying to get is from questions table is when I select TechId 1 it should load all questions up to nth level. Result expecting is
TechId Desc ParentId
1 A Null
2 B 1
3 C 1
4 D 2
My Question table is as follows
QId TId desc
1 1 Q1
2 2 Q2
3 3 Q3
4 4 Q4
What I am trying to get is from questions table is when I select TechId 1 it should load all questions up to nth level. Result expecting is
QId TId Desc
1 1 Q1
2 2 Q2
3 3 Q3
4 4 Q4
ASKER
Hi one small help can I get the count like for TechnologyId 1 it should show as 4 and for 2 as 1 respectively
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Provided verified solution.
Open in new window
OUTPUT
Open in new window