Last active
January 28, 2022 16:05
-
-
Save appleseedexm/ae153afa04e20fcef27351ceda22f23e to your computer and use it in GitHub Desktop.
get all unused ids of an oracle db table
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 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