rrchowdhary
Programmer
Hi
I have stucked up with writing stored procedure to get the desired output.would appreciate help in from you all
i would like to get the intersection,union and set of records based on the Type
Here is the data in my table
Resourceclasses
-------------------
ResourceClassId Name Type
-----------------------------------------------
1 Resource Classes 6
2 All Resources 5
3 Set1 5
4 List of Resource 5
5 Union 6
6 Intersect 7
7 Intersection 7
8 Union1 6
Type 5:Set of Resource classes
Type 6:Union of Resource classes
Type 7:Intersection of Resource classes
ResourceclassMembers
----------------------
ResourceClassId SubclassId ResourceId
-------------------------------------------
3 0 1011
3 0 1001
3 0 1015
4 0 1001
4 0 1009
4 0 1004
5 4 0
5 3 0
6 4 0
6 5 0
7 3 0
7 6 0
7 4 0
7 5 0
8 3 0
8 7 0
Desired Output
ResourceClassId ResourceId
3 1011
3 1001
3 1015
---------------------------
5 1011
5 1001
5 1015
5 1009
5 1004
-------------------------------
6 1001
6 1009
6 1004
-----------------------------
Each ResourceclassId in the Resourceclass Table belongs to a Type which is either(5-Set,6-Union,7-Intersection)
which is linked to ResourceClassmembers table
If you look at the ResourceClasses table
ResourceClassId 5 is made up of (Union of)two resourceclasses 3 and 4
so the output for ResourceclassId 5 is
5 1011
5 1001
5 1015
5 1009
5 1004
where as the ResourceclasId 3 is of type(Set)which has no Subclasses so we return ResourceId for them.
3 1011
3 1001
3 1015
simillarly it is same with ResourceClassId 6(of type Intersection)is made up of two classes
4 and 5
Hope i was able to explain my problem clearly..Apologise if any thing wrong with my explanation
Thanks
I have stucked up with writing stored procedure to get the desired output.would appreciate help in from you all
i would like to get the intersection,union and set of records based on the Type
Here is the data in my table
Resourceclasses
-------------------
ResourceClassId Name Type
-----------------------------------------------
1 Resource Classes 6
2 All Resources 5
3 Set1 5
4 List of Resource 5
5 Union 6
6 Intersect 7
7 Intersection 7
8 Union1 6
Type 5:Set of Resource classes
Type 6:Union of Resource classes
Type 7:Intersection of Resource classes
ResourceclassMembers
----------------------
ResourceClassId SubclassId ResourceId
-------------------------------------------
3 0 1011
3 0 1001
3 0 1015
4 0 1001
4 0 1009
4 0 1004
5 4 0
5 3 0
6 4 0
6 5 0
7 3 0
7 6 0
7 4 0
7 5 0
8 3 0
8 7 0
Desired Output
ResourceClassId ResourceId
3 1011
3 1001
3 1015
---------------------------
5 1011
5 1001
5 1015
5 1009
5 1004
-------------------------------
6 1001
6 1009
6 1004
-----------------------------
Each ResourceclassId in the Resourceclass Table belongs to a Type which is either(5-Set,6-Union,7-Intersection)
which is linked to ResourceClassmembers table
If you look at the ResourceClasses table
ResourceClassId 5 is made up of (Union of)two resourceclasses 3 and 4
so the output for ResourceclassId 5 is
5 1011
5 1001
5 1015
5 1009
5 1004
where as the ResourceclasId 3 is of type(Set)which has no Subclasses so we return ResourceId for them.
3 1011
3 1001
3 1015
simillarly it is same with ResourceClassId 6(of type Intersection)is made up of two classes
4 and 5
Hope i was able to explain my problem clearly..Apologise if any thing wrong with my explanation
Thanks