Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all,
I'm currently struggling with a data join exercise. The data is sourced via SQL from Hadoop Hive.
I have following data:
Now I need to match the expiring date from table 3 to the ID's in table 1.
There are cases some though where ID's got replaced by other ones as you can see in table 2. For this cases the expiring date of the last replacement (e.g. C) needs to be added to all replaced IDs (A and B).
Is there a way to do that in the load script?
I thank you all in advance for your time!
Table 1 | Table 2 | Table 3 | ||||
ID | ID | replaced_ID | ID | expiring_date | ||
A | B | A | A | 01.01.2019 | ||
B | C | B | B | 01.02.2019 | ||
C | C | 01.03.2019 | ||||
D | D | 01.04.2019 | ||||
E | E | 01.05.2019 |
edit: changed the attachment format
Thanks for the heads up.
I now added the table to the post as well as an Excel.
Now you should be able to see it.