SQL query for a table with 1.7 millon rows

purceld2

Registered User.
Local time
Today, 06:30
Joined
Dec 4, 2008
Messages
79
I have just obtained a database with 1.7million UK post codes along with there latitudes and longitude's.
I have a list of over 8000 post codes in an excel spreadsheet which I need to get the lat long's for

what would be the best way to this?

Thanks in advance for your help
 
Either copy your excel spreadsheet to your db or link to it (better to copy)

Then you need a simple query (change table and field names to suit):

Code:
SELECT ExlTbl.Postcode, LatLongTbl.Latitude, LatLongTbl.Longitude 
FROM ExlTbl INNER JOIN LatLong ON ExlTbl.Postcode=LatLongTbl.Postcode

It should only take a few seconds to run, but if taking a long time, ensure the postcode field in each table is indexed
 
Assuming the PostCode in both record sets is the same format and data type, then import or link the Excel data then create a query of the two record sets using Inner Join on the PostCode field. You can then do whatever you need to with the query results (display it, export it, update another record set, etc.)
 

Users who are viewing this thread

Back
Top Bottom