Reputation: 263
I am using the following query to identify the newEndDate
But, the result i get is
Why am i not getting newEnddate for the last row ? please help
Upvotes: 0
Views: 1143
Reputation: 50173
You can use same column in lead()
in last parameter :
lead(se.status_startdt, 1, se.status_startdt) over (partition by se.invoice_number order by se.status_startdt)
As per sample data this seems to be use of coalesce()
:
coalesce(se.status_enddt, se.status_startdt)
Upvotes: 1