1 9 cal big
1 9 cal small
2 9 cal big
2 9 cal small
4 10 Nev small
4 10 Nev big
3 16 Ill big
I want the output like this ( For the primary_id in table 'b' I want the parent of and child of to be populated based
on table 'a' in the out put .
ID primary_id primary_name type parent of child of
1 9 cal big 10 null
1 9 cal small 10 null
1 9 cal big 11 null
1 9 cal small 11 null
2 9 cal big 10 null
2 9 cal small 10 null
2 9 cal big 11 null
2 9 cal small 11 null
4 10 Nev small null 9
4 10 Nev big null 9
3 16 Ill big null null
Thanks in advance
Microsoft DevelopmentMicrosoft SQL ServerMicrosoft SQL Server 2008
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.