Skip to content

Instantly share code, notes, and snippets.

@appleseedexm
Last active January 28, 2022 16:05
Show Gist options
  • Save appleseedexm/ae153afa04e20fcef27351ceda22f23e to your computer and use it in GitHub Desktop.
Save appleseedexm/ae153afa04e20fcef27351ceda22f23e to your computer and use it in GitHub Desktop.
get all unused ids of an oracle db table
select min_a - 1 + level
from ( select min(id) min_a
, max(id) max_a
from tabledata
)
connect by level <= max_a - min_a + 1
minus
select id
from tabledata
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment