Re: SQL, forcing a sequential evaluation among clauses of a lilter

From: Jurij Modic <jurij.modic_at_mf.sigov.mail.si>
Date: Thu, 14 May 1998 21:39:14 GMT
Message-ID: <355b647e.7744334_at_www.sigov.si>


On Thu, 14 May 1998 08:53:45 +0200, ebaechle_at_hospvd.ch (Informatique) wrote:

>
>> properties >= to_char(Min_batch_number) AND
>> properties <= to_char(Max_batch_number);
>>
>> This will work if you can be sure that your 'properties' are allways numeric
>> and data type varchar2. Also, this one will use index o properties (if there
>> is one).
>
>You're absolutely right. I forgot this possibility.

Don't be so sure this will work! Remember that when you compare numbers represented as strings, they will be compared based on their characters, not based on their numerical representation. A very trivial example:

properties = '10', Min_batch_number = 3, Max_batch_number = 30 and the above where condition will evaluate to FALSE, although 3 <= 10 <=30 !

>Emmanuel Baechler
>Lausanne
>Switzerland

Regards,


Jurij Modic                             Republic of Slovenia
jurij.modic_at_mf.sigov.mail.si		Ministry of Finance
============================================================
The above opinions are mine and do not represent any official standpoints of my employer Received on Thu May 14 1998 - 23:39:14 CEST

Original text of this message