DBAsupport.com Forums - Powered by vBulletin
Results 1 to 10 of 27

Thread: Missing Numbers (Between two numbers)

Threaded View

  1. #8
    Join Date
    Nov 2002
    Location
    Geneva Switzerland
    Posts
    3,142
    Do either of the above allow for a gap of two or more?

    How about:
    Code:
    Select * From 
    (SELECT :v_lower + ROWNUM AS missing_number
     FROM ALL_OBJECTS, ALL_OBJECTS
     WHERE ROWNUM < :v_upper - :v_lower)
    Where missing_number not in 
    (select my_col from my_table
     where  my_col is not NULL);
    With aknowledgements to Jurij.

    P.S: just noticed we need 100'000 numbers! Hope this won't blow the temp area!
    Last edited by DaPi; 04-08-2004 at 08:19 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Click Here to Expand Forum to Full Width