Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
I would like to add 0 values for some ID`s that are missing in one day.
So the values that I`m loading would look something like this :
DATE | DEP_ID | VALUE |
---|---|---|
27-Feb-2018 | 1 | 10 |
27-Feb-2018 | 2 | 11 |
27-Feb-2018 | 3 | 9 |
27-Feb-2018 | 4 | 12 |
26-Feb-2018 | 1 | 2 |
26-Feb-2018 | 2 | 5 |
26-Feb-2018 | 3 | 13 |
26-Feb-2018 | 4 | 12 |
26-Feb-2018 | 5 | 20 |
26-Feb-2018 | 6 | 21 |
What I want to achieve is in this table
DATE | DEP_ID | VALUE |
---|---|---|
27-Feb-2018 | 1 | 10 |
27-Feb-2018 | 2 | 11 |
27-Feb-2018 | 3 | 9 |
27-Feb-2018 | 4 | 12 |
27-Feb-2018(added) | 5(added) | 0(added) |
27-Feb-2018(added) | 6(added) | 0(added) |
26-Feb-2018 | 1 | 2 |
26-Feb-2018 | 2 | 5 |
26-Feb-2018 | 3 | 13 |
26-Feb-2018 | 4 | 12 |
26-Feb-2018 | 5 | 20 |
26-Feb-2018 | 6 | 21 |
As you can see I need to add missing DEP_ID`s for a DATE with values 0.
Can you please help me?
Thank you.
Hi,
what do you mean by missing ID ?
the ID's are always from 1 to 6 ?
Yes , I need the list to be static , but in some days ,from database , are brought only 3, or 4 etc. And when there are fewer than the static list , to add missing ID`s with value 0