Re: oracle sql case statement

From: Only Oracle Information\(except job\) <"Only>
Date: Mon, 11 Feb 2002 18:40:01 -0500
Message-ID: <NAY98.5752$JZ.891713_at_news20.bellglobal.com>


make sql statement as following...

select p.name,

         decode(p.ddate,'01/01/2001','bigining of year',nvl(p.disposed,'Alive'))

   from persons p;

good luck!



  I can change the world!!
  bradsuk_at_sympatico.ca

"Michael" <cipriano_at_eng.utah.edu> wrote in message news:2cf417fd.0202111412.78b44603_at_posting.google.com...
> How do I do a case statement within oracle 8.0.3 to do the following
>
>
> SELECT p.name,
> CASE WHEN p.ddate='01/01/2001' THEN 'begining of year' WHEN p.disposed
> is null then 'Alive'
> from persons p;
>
>
> This is a totaly made up example so it might not make sense, but this
> should return the following
>
>
> mike begining of year
> joe Alive
> tammy beginning of year
>
> from this table
> mike 01/01/2001 NULL
> joe 01/02/2001 NULL
> tammy 01/01/2001 Y
>
> Thanks
Received on Tue Feb 12 2002 - 00:40:01 CET

Original text of this message