Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Finding next number in custom sequence
select greatest(nvl(mod(max(seq_num) + 1, 2048), 0), 1) from your_table
where greatest(mod(seq_num + 1, 2048), 1) not in (select seq_num from
your_table)
and destination = 'something'
If you had begun the sequence with 0, it would have been easier :-)
Bye,
Flavio
Received on Tue May 07 2002 - 14:47:10 CDT