[odb-users] Generate "Valite_to" from next "valid_from"
Javier Gutierrez
javier.gutierrez at web.de
Sun Dec 29 15:32:53 EST 2019
Hi there,
I have a table only with a valid_from column, I need to make a range out of
it, so the valid_to for current row is the valid_from of the next row. I am
talking about timestamps if it makes any difference.
E.g.
ID, ITEM_ID, VALID_FROM -> VALID_TO
1, 1, 2019.01.01 -> 2019.02.15
2, 1, 2019.02.15 -> 2019.03.07
3, 1, 2019.03.07 -> 2100.01.01
4, 2, 2019.01.20 -> 2019.03.01
5, 2, 2019.03.01 -> 2100.01.01
I need to generate this column on the fly because I am querying against it.
Additionally I need this to work on any database.
Any ideas how to do this using ODB or if it is possible at all ?
Thanks a lot in advance,
Javier
More information about the odb-users
mailing list