Skip to content

Instantly share code, notes, and snippets.

@meanother
Created October 14, 2021 19:26
Show Gist options
  • Save meanother/70c69941fe89bec146b80fca3bb86608 to your computer and use it in GitHub Desktop.
Save meanother/70c69941fe89bec146b80fca3bb86608 to your computer and use it in GitHub Desktop.
select
id
, title
, create_dt
, score
, status
, comments
, action
, valid_from
, coalesce(
lead(valid_from) over(partition by id order by valid_from asc), '2999-12-31'
) as valid_to
from
home.dth_banki_responses
where
id = 10556512
order by
valid_from asc;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment