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

Home -> Community -> Mailing Lists -> Oracle-L -> Re: Min of decode explaination

Re: Min of decode explaination

From: Jared Still <jkstill_at_cybcon.com>
Date: Thu, 29 Jul 2004 07:53:30 -0700
Message-Id: <1091112810.30520.295.camel@poirot>


On Thu, 2004-07-29 at 07:31, Lee Lee wrote:

> SQL> select min(plan_start_dt),
> min(decode(ord_stat,'OP','',plan_start_dt))
>
> from test_tbl;
>
> MIN(PLAN_ MIN(DECOD
> --------- ---------
> 03-NOV-04 01-DEC-04
>
> 1 row selected.
>

try:

select min(a.plan_start_dt), min(a.plan_start_dt2) from (

   select plan_start_dt,
     decode(ord_stat,'OP','',plan_start_dt) plan_start_dt2    from test_tbl
) a

Jared



Please see the official ORACLE-L FAQ: http://www.orafaq.com

To unsubscribe send email to: oracle-l-request_at_freelists.org put 'unsubscribe' in the subject line.
--
Archives are at http://www.freelists.org/archives/oracle-l/
FAQ is at http://www.freelists.org/help/fom-serve/cache/1.html
-----------------------------------------------------------------
Received on Thu Jul 29 2004 - 09:42:20 CDT

Original text of this message

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