If you want to get ZIP codes which are located near to a given ZIP Code, the default way is to get altitude and longitude from Google Maps or any other GEO service and make your query.
The results will of course not be as good as with a GEO service, but in some cases this will be enough:
For example you want to get all entries of a user table which are located near to the ZIP „47551“.
Of course exact matches must be on top:
SELECT name,zip,city FROM user
WHERE zip BETWEEN 47500 AND 47599
ORDER BY (zip = 47551 ) DESC , (zip LIKE '4755%' ) DESC, (zip LIKE '475%' ) DESC , zip DESC