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: select statment with between date parameters

Re: select statment with between date parameters

From: Valery Yourinsky <vsu_at_softexpress.ru>
Date: Wed, 16 Jun 1999 15:38:46 +0300
Message-ID: <37678c46@mail.softservice.ru>


dagger <rtpz_at_hotmail.com> wrote in message news:7i8trs$nt2$1_at_remarQ.com...
>
>Chistine Do <chrisintine_at_idec.com> wrote in message
>news:zLl13.10838$wq2.44633_at_nuq-read.news.verio.net...
>> Hello All,
>> I would like to know how to create a select statement using the greatest
>and
>> least to select the date parameters (ex. 05-aug-98 to 05-apr-99) without
>> using the where clause.
>>
>> Please advice!
>>
>> Thanks
>> Christine
>> email: christine_at_idec.com
>>
>>
>Consider creating a function:
>fid(date1 IN DATE) RETURN PLS_INTEGER
> ...return 0 or 1
>Then in select statement: SELECT DECODE(fid,1,<something>,...
>
>Of course, it depends on what your are trying to select, or sum possibly?

User function is not very efficient way.

Instead of expression

    A between B and C
you can use

    DECODE( SIGN(A-B), -1, 0, DECODE(SIGN(A-C),1,0,1)) About this method Igor Filimonov (ifilimon_at_ru.oracle.com) said to me.

Valery Yourinsky
---
Softservice, Moscow
ORACLE PARTNER
tel/fax (095) 333-63-10, 128-18-21
http://www.softexpress.ru
ICQ# 368 97 94
second E-mail: vsur_at_usa.net Received on Wed Jun 16 1999 - 07:38:46 CDT

Original text of this message

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