Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I have 2 tables:
T_1:
| ID | end_date | Value |
| 1 | 19.09.2019 | 500 |
| 2 | 20.09.2019 | 100 |
| 3 | 21.09.2019 | 200 |
T_2:
| ID | Value date | Value |
| 1 | 19.09.2019 | 500 |
| 2 | 20.09.2019 | 100 |
| 5 | 21.09.2019 | 700 |
I need to sum by Value date from Table 2 and the sum from table 1 by end date if the ID of Table 1 is not already in table 2. Is this possible?
In this Case it would me give following sums
| ID | Value date | Value |
| 1 | 19.09.2019 | 500 |
| 2 | 20.09.2019 | 100 |
| 3 | 21.09.2019 | 200 |
| 5 | 21.09.2019 | 700 |
Hi,
try to load Table 2 first, then load Table 1 but add a "where not exists(id)" as condition of load
May it be the best by merging the tables already in the script? The End Date, Value date are the same
Hi,
try to load Table 2 first, then load Table 1 but add a "where not exists(id)" as condition of load
Thanks, yes it works!