We have many fake account numbers in the database table. I would like to find those which are consecutive incremental numbers. For example, 123456789 and 12345 but do not include imbedded consecutive numbers. For example, 1234598 would not be a candidate.
select acct_nbr
from account
where acct_nbr like ('12345%', '5432%');
I want 12345678 but not 123458888 and similarly 54321 but not 54329.
How should I get? Is there any regexp_like which I can use?