Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have quite a complex data model.
But for this issue I am concerned with 5 tables:
TableA links to TableB via keyAB, TableB links to TableC using keyBC, …, Table D links to TableE via keyDE (you get the idea!)
I have a field in TableE that I need to be in TableA
How to pull this field across the data model (i.e. through the tables) to TableA?
Many thanks for your assistance with this matter.
Could be something like this:
Left join(TableD)
Load
keyDE,
FieldX as FieldXinTableD
resident TableE;
Left join(TableC)
Load
keyCD,
FieldX as FieldXinTableC
resident TableD;
Left join(TableB)
Load
keyBC,
FieldX as FieldXinTableB
resident TableC;
Left join(TableA)
Load
keyAB,
FieldX as FieldXinTableA
resident TableB;
THE JOIN TYPE DEPEND ON YOUR DATAMODEL
Even if your field in Table E has multiple values for every row in Table A?
There is no general technique to do that, except by propagating your field in TableE to all the other tables. You may end up blowing up your tables though...
Could be something like this:
Left join(TableD)
Load
keyDE,
FieldX as FieldXinTableD
resident TableE;
Left join(TableC)
Load
keyCD,
FieldX as FieldXinTableC
resident TableD;
Left join(TableB)
Load
keyBC,
FieldX as FieldXinTableB
resident TableC;
Left join(TableA)
Load
keyAB,
FieldX as FieldXinTableA
resident TableB;
THE JOIN TYPE DEPEND ON YOUR DATAMODEL
This is almost exactly what I have been trying, but you have approached it from a differnt angle, I will explore your option and it should be OK. Thanks.