Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: sql quiz
Hi,
A simple solution will be..
create a sequence start with 1, increment by 1.
& run this query..
select decode(C1-seq.nextval,0,C1,seq.nextval) from t1;
U will get the result.
Avinash
Ari Kaplan wrote:
>
> Naren Chintala (naren_at_att.com) wrote:
> : Hi,
> : SQL> describe t1;
> : Name Null? Type
> : ------------------------------- -------- ----
> : C1 NUMBER
> :
> : SQL> select c1 from t1;
> :
> > : Question:
> :
> : I need to retrieve the missing numbers (2,3,5,6) from t1.
> : How can I do this in ONE sql statement?
> : I know that this can be done in PL/SQL.
> :
> : Any ideas?
> : Thanks
> : Naren
> Naren,
>
>
Received on Tue Jan 06 1998 - 00:00:00 CST