Quantcast
Channel: Toad for Oracle Forum - Recent Threads
Viewing all articles
Browse latest Browse all 4385

RE: find gaps between numbers

$
0
0
SQL> select * from t order by x;

         X
----------
         1
         2
         5
         6
         7
        10
        12
        13

SELECT ROWNUM FROM dual CONNECT BY LEVEL <= xxx MINUS SELECT col_of_numbers FROM your_table;

where xxx is max numbers that are in your_table table. In this case 13. result is:

ROWNUM
----------
         3
         4
         8
         9

SQL> 

Viewing all articles
Browse latest Browse all 4385

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>