Created
April 11, 2020 20:04
-
-
Save shortcircuit3/3e9d2a3c9f217ef05105061e2038307a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
select "sequence".id + 1 as start, min(fr.id) - 1 as stop | |
from "sequence" | |
left outer join sequence as r on "sequence".id = r.id - 1 | |
left outer join sequence as fr on "sequence".id < fr.id | |
where r.id is null and fr.id is not null | |
group by "sequence".id, r.id; |
Author
shortcircuit3
commented
May 5, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment