Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: sql or pl sql to do this?
"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 Decision6 from all_objects
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