I have a table part with a few demo data as below in Oracle DB:
ID NUMBER DESCRIPTION
1 T00001 test
2 T00002 test
3 T00003 test
4 T00004 test
5 T00008 test
6 SG0001 test
7 SG0002 test
8 SG0003 test
9 SG0004 test
10 SG0006 test
The column NUMBER defines different category part with different predefined prefix and auto-incremental number suffix. Now in DB there have been some numbers missed so the continuity is broken. I want a SQL query or PL-SQL function with perfect performance to list the missed numbers:
e.g: for the above demo data. the following data should be returned:
Category1 start with T: T00005,T00006,T00007
Category1 start with SG: SG0005
Anybody have ideas?
For SG:
For T: