I have a table with below data
PRODUCT_ID ORDER_DATE NEW_ORDER_DATE
1000 2007/09/15 NULL
1000 2007/09/17 Null
1000 2007/09/20 Null
1000 2007/09/23 Null
1000 2007/09/25 Null
1000 2007/09/27 Null
And i have to update new_order_date with data as below
PRODUCT_ID ORDER_DATE NEW_ORDER_DATE
1000 2007/09/15 2007/09/16
1000 2007/09/17 2007/09/19
1000 2007/09/20 2007/09/22
1000 2007/09/23 2007/09/24
1000 2007/09/25 2007/09/26
1000 2007/09/27 2100/01/01
As you can see the new_order_date is always computed based on the next row order_date for the same product_id using date - 1 and the last row is updated to a default date 2100/01/01. Could you please let me if there any function that i can use to achieve this