Hot answers tagged

1

Oracle supports LAG so you should be able to do something like. SELECT T.ID, T.NAME FROM ( SELECT ID, NAME, LAG(ID) OVER (ORDER BY ID) AS PREVID FROM YourTable ) T WHERE ID > PREVID + 1; To compare the Id with the previous one and only return ones with a gap greater than 1. (Untested as SQL Fiddle is currently returning errors ...


1

ORA-00913 too many values Cause: The SQL statement requires two sets of values equal in number. This error occurs when the second set contains more items than the first set. For example, the subquery in a WHERE or HAVING clause may return too many columns, or a VALUES or SELECT clause may return more columns than are listed in the INSERT. Action: ...



Only top voted, non community-wiki answers of a minimum length are eligible