(Itβs hard for me to even explain this question)
I have 5 tables, A , AZ , Z , BZ , B
AZ is a many-to-many relationship between A and Z BZ represents the many-to-many relationship between B and Z
I need a result set that is AB , where B is associated with the complete set Z for given A
So, let's say that Z is a tag table and contains:
Tag1 Tag2 Tag3
A is a table of objects and contains:
ObjectA ObjectB ObjectC
B is a widget table and contains:
WidgetX WidgetY WidgetZ
AZ contains:
ObjectA Tag1 ObjectA Tag2 ObjectB Tag3 ObjectC Tag2 ObjectC Tag3
BZ contains:
WidgetX Tag1 WidgetX Tag2 WidgetY Tag2 WidgetY Tag3 WidgetZ Tag3
I want my result set to be:
ObjectA WidgetX ObjectB WidgetY ObjectB WidgetZ ObjectC WidgetY
Is this feasible in the query or do I need to undo some intermediate datasets and iterate through the code?
source share