MySQL Forums
Forum List  »  Newbie

query problems
Posted by: Brad
Date: July 03, 2005 10:59AM

Hi,
I'm having a problem with a query I'm sending. I have a table of GIS data containing columns:

id INT PRIMARY KEY NOT NULL AUTO INCREMENT
long FLOAT NOT NULL
lat FLOAT NOT NULL
winWeibC FLOAT NOT NULL
winWeibK FLOAT NOT NULL
etc...

I have about 7.5 million fields in the table and want to query one entry based on latitude and longitude. When I execute the query using the following script I get an empty set:

SELECT winWeibK FROM my_DB WHERE lat=31.018 AND long=-111.197;

However, when I send the following query I get a successful result:

SELECT winWeibK FROM my_DB WHERE id=7642;

This doesn't help me though since I don't know the correct id number, I only know the latitude and longitude. Any idea why I'm getting an empty set on my composite query? If it helps, I also had the idea of doing "SELECT * FROM my_DB WHERE lat=31.018", then querying those results for the longitude, but got an empty set from the above quoted query so I couldn't even try a second query.

Basically it'll only let me query with the primark key. Is that normal? If so, how do I get around it?

Thanks

Options: ReplyQuote


Subject
Written By
Posted
query problems
July 03, 2005 10:59AM
July 03, 2005 11:29AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.