Submitted Questions

  • How to identify missing records in a single-column table?

    How to identify missing records in a single-column table ?Column consists of numbers in a ordered manner but the some numbers are deleted from the table in random manner and need to identify those rows.p.s. This table consist of only 1 row.

    Satya

    • Sep 20th, 2011

    "sql SELECT CASE WHEN ConNum - prev_id = 2 THEN TO_CHAR( prev_id +1) ELSE '[' || NVL( prev_id +1 ,1 ) || ' , ' || (ConNum-1) || ']' END AS missing_range , ConNum - NVL...

    geetha

    • Aug 25th, 2011

    Code
    1. SELECT LEVEL FROM dual
    2. CONNECT BY LEVEL <=10
    3. MINUS
    4. SELECT a FROM test
    5.  
    where the test table is like colA 2 4 6 7 the result will be the missing numbers..