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

Home -> Community -> Usenet -> c.d.o.misc -> Re: sql or pl sql to do this?

Re: sql or pl sql to do this?

From: Mark D Powell <mark.powell_at_eds.com>
Date: 13 May 2002 07:07:33 -0700
Message-ID: <178d2795.0205130607.7345bb80@posting.google.com>


"gil guerillot" <gil.guerillot_at_ratp.fr> wrote in message news:<abo296$1f70$1_at_gotix.reseau.ratp>...
> i 'd like to know with sql if an object is installed between 2 dates
> (start_date and end_date) in a where clause
>
> table objects: code_object,date_in ,date_out
>
> i want a result like this
>
> object1 yes
> object2 yes
> object3 no
> object4 yes ....

Gil, with version 8+ you can do something like: 1 select object_name

  2        ,case when created between to_date('1-jan-02','DD-MON-YY') and
  3                                   to_date('31-jan-02','DD-MON_YY')
  4              then 'Yes'
  5              else 'No' end as Decision
  6 from all_objects
  7 where owner = 'XXXXXX'
  8* and object_type = 'TABLE'
OBJECT_NAME                    DEC
------------------------------ ---
VENDOR_FAXGATE                 No
VM_SQE_TEMP                    Yes

<edited for display>

HTH -- Mark D Powell -- Received on Mon May 13 2002 - 09:07:33 CDT

Original text of this message

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