J
James Minns
I would like to know if it is possible to "explode" a table via a query;
here is a small example
Table fields
ID number
Type text (E or M)
Source_Ref text
Dest_Ref text
The "type" field can be either E for Element or M for Mix.
the following table should be in columns...
ID Type Source_Ref Dest_Ref
0 E E1 D1
1 E E2 D2
2 E E3 D3
3 M E1 D4
4 M E2 D4
5 M D4 D5
6 M E3 D5
I need a method to obtain the components of Dest_Ref D5,
which is a mix of D4 and E3. D4 is a mix of E1 and E2 so the
component list should be:
Element
E3
E1
E2
The Source_Ref field should be "recursively exploded" until all the mixes
are resolved to elements. There is no way of knowing how many 'nesting'
levels there might be in the data.
Is there any way to get this result in an SQL query?
Thanks for any help,
James
here is a small example
Table fields
ID number
Type text (E or M)
Source_Ref text
Dest_Ref text
The "type" field can be either E for Element or M for Mix.
the following table should be in columns...
ID Type Source_Ref Dest_Ref
0 E E1 D1
1 E E2 D2
2 E E3 D3
3 M E1 D4
4 M E2 D4
5 M D4 D5
6 M E3 D5
I need a method to obtain the components of Dest_Ref D5,
which is a mix of D4 and E3. D4 is a mix of E1 and E2 so the
component list should be:
Element
E3
E1
E2
The Source_Ref field should be "recursively exploded" until all the mixes
are resolved to elements. There is no way of knowing how many 'nesting'
levels there might be in the data.
Is there any way to get this result in an SQL query?
Thanks for any help,
James