Subject | Re: [firebird-support] Help with strange answer in WHERE clause |
---|---|
Author | Arno Brinkman |
Post date | 2004-05-03T21:20:29Z |
Hi,
('2' is higher as '1000' !) ?
You're filtering on a varchar not on a number !
Regards,
Arno Brinkman
ABVisie
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Firebird open source database (based on IB-OE) with many SQL-99 features :
http://www.firebirdsql.org
http://www.firebirdsql.info
http://www.fingerbird.de/
http://www.comunidade-firebird.org/
Support list for Interbase and Firebird users :
firebird-support@yahoogroups.com
Nederlandse firebird nieuwsgroep :
news://80.126.130.81
> I am having a strange behaviour in a SELECT statement. The fieldAnd you've only entries which have a starting character greater than '1000'
> 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.
> Thanks.
('2' is higher as '1000' !) ?
You're filtering on a varchar not on a number !
Regards,
Arno Brinkman
ABVisie
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Firebird open source database (based on IB-OE) with many SQL-99 features :
http://www.firebirdsql.org
http://www.firebirdsql.info
http://www.fingerbird.de/
http://www.comunidade-firebird.org/
Support list for Interbase and Firebird users :
firebird-support@yahoogroups.com
Nederlandse firebird nieuwsgroep :
news://80.126.130.81