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: sql quiz

Re: sql quiz

From: Avinash Deshpande <avdeshpa_at_cisco.com>
Date: 1998/01/06
Message-ID: <34B2A507.3123@cisco.com>#1/1

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

Original text of this message

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