Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Query to return PK sequence gap ??

Re: Query to return PK sequence gap ??

From: Brian Tkatch <N/A>
Date: Wed, 10 Oct 2007 09:22:42 -0400
Message-ID: <4gkpg3dcf5akfg4d5cja002oml4c95708h@4ax.com>


On 10 Oct 2007 10:51:12 GMT, Mladen Gogala <mgogala_at_yahoo.com> wrote:

>On Tue, 09 Oct 2007 12:15:50 -0700, Jagjeet Singh wrote:
>
>> SQL> select rownum from (select 1 from dual connect by level <=
>> &max_no)
>> 2 minus
>> 3 select emp_id from emp_test
>> 4 /
>>
>> Enter value for max_no: 8
>>
>> ROWNUM
>> ----------
>> 2
>> 4
>> 6
>> 7
>> 8
>
>This is the best version I've seen so far. My use of analytic functions
>was unnecessary. I was thinking of obtaining gaps in a different format,
>when I read the specification again.

But this solution does not work in 9i.It does work in 10g.

B. Received on Wed Oct 10 2007 - 08:22:42 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US