Subject | Re: [firebird-support] Help with strange answer in WHERE clause |
---|---|
Author | Ann W. Harrison |
Post date | 2004-05-03T21:22:23Z |
At 05:03 PM 5/3/2004, hcarvajalsy wrote:
were strings. The string '1000' sorts lower than the string '999'. If you
want numeric comparisons, you should define the field to be numeric.
Regards,
Ann
>Hello,If you define the field as varchar, comparisons are done as if the values
>I am having a strange behaviour in a SELECT statement. The field
>over which I do the WHERE is defined as VARCHAR(5). If I do:
>SELECT COUNT(*) FROM STUDENTS WHERE SCHOOL <= '999';
>
>I get 10,569 as the answer, but if I do:
>SELECT COUNT(*) FROM STUDENTS WHERE SCHOOL <= '1000';
>
>I get 0 as the answer.
were strings. The string '1000' sorts lower than the string '999'. If you
want numeric comparisons, you should define the field to be numeric.
Regards,
Ann