Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
Could you please help me out with this problem:
I have for example fallowing table
TABLE_NAME:
LOAD * inline [
ID|Value|Version
1|3|1-1-2019
1|4|2-1-2019
3|8|1-1-2019
2|1|1-1-2019
5|2|1-1-2019
5|1|2-1-2019
] (delimiter is '|');
I would like to have fallowing result:
ID|Value|Version
1|4|2-1-2019
3|8|1-1-2019
2|1|1-1-2019
5|1|2-1-2019
So the output takes only newest version only if there is a updated, otherwise last version is applicable.
Thank you in advance!
Greetings
Przemyslaw
I think you may use a group by clause.
Something like this:
Load ID, Value,
Max(Version)
resident (TABLE_NAME)
group by ID, Value;
Hi,
This solution could work if Value would be the same. In my case Value is changed with update.