IN or BETWEEN

From: Carlos <miotromailcarlos_at_netscape.net>
Date: 23 Apr 2002 02:13:36 -0700
Message-ID: <1de5ebe7.0204230113.42cd2d4d_at_posting.google.com>



Hello everyone.
[Quoted] [Quoted] I am designing a DB with Oracle Designer. When I add 'allowable [Quoted] [Quoted] 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 Tue Apr 23 2002 - 11:13:36 CEST

Original text of this message