Re: IN or BETWEEN

From: CJ Butcher <cj_at_cjbutcher.com>
Date: Thu, 25 Apr 2002 03:49:48 GMT
Message-ID: <w1Lx8.1196$cw4.426685655_at_newssvr13.news.prodigy.com>


[Quoted] Use between, it is faster.

"Carlos" <miotromailcarlos_at_netscape.net> wrote in message news:1de5ebe7.0204230113.42cd2d4d_at_posting.google.com...
> Hello everyone.
> I am designing a DB with Oracle Designer. When I add 'allowable
> values' for a column I have two choices:
> 1.- Adding values separately (i.e: adding '0' as a 'allowable value'
> and then adding '1' as another 'allowable value'). This will generate
> a check constraint of type IN ( x_column IN (0,1)).
> 2.- Adding values by intervals (i.e: adding '0' as a 'allowable value'
> with '1' as 'high value'). This will generate a check constraint of
> type BETWEEN ( x_column BETWEEN 0 AND 1 ).
> I always assumed that expresions of type 'BETWEEN' are quicker than
> expressions of type 'IN' (at least talking in Oracle terms).
> Am I right in this assumption?
> And yet another question: Do expresions of type 'BETWEEN' work like
> expresions with <= and >= or not?
> Thanks in advance and regards from Spain.
Received on Thu Apr 25 2002 - 05:49:48 CEST

Original text of this message