Reputation: 335
I have some table "tab1", which contains the sample data as like follws
I am expecting the output like as follows
How to implement in "BIGQUERY", Please help me to achieve this.
Thanks Kalyan
Upvotes: 0
Views: 1140
Reputation: 1269563
I think you just need lead()
:
select t.*,
lead(effective_from, 1, date('9999-12-31')) over
(partition by sno
order by effective_from
) as effective_to
from t
Upvotes: 3