Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

mysql - sql syntax or bug ?

Status
Not open for further replies.

samoy

Programmer
Jan 7, 2001
1
AU
Could someone help me out here?. I have just recently uploaded some geographic coordinates into mysql and using mysql to retrieve records based on geographic coordinate values.

mysql> select count(*) from VDR where (LATITUDE between -38 and -37)

mysql returns 0 records (which is wrong because all of the Latitude values is less than -37)

but

mysql> select count(*) from VDR where (LATITUDE between -38 and -3)

mysql returns 997913 records which is correct. Somehow, mysql does not like the double digit figures for the second negative number.

Could this be a mysql bug or just a sql syntax problem ?

Sam

 
Could it be because you do not have the values enclosed in single quotes (') because the negative sign would make them strings?

I am by no means a mySQL expert, but it is just something that you could try.

Hope this helps,

-Vic vic cherubini
malice365@hotmail.com
====
Knows: Perl, HTML, JavScript, C/C++, PHP, Flash, Director
====
 
I tried it and it appeared to work correctly. How exactly have you defined your columns?

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top