Getting the next lower value if no result

admin

Administrator
Staff member
Hi!
I have a project w/ 2 tables:
table user - contains info about the user and the zip-code the user entered
table zip - contains all the zip codes, longitude,etc.
I know how to get zip codes within a certain range from a certain zip in the zip-table, but now I would like to show zip codes within a certain radius from the user.
The problem is that the table zip is not complete, because some cities have several zip codes and only one of them is stored in the DB.
I would like to query the database and if a zip code doesn't exist I'd like to take the next lower value - but how do I do that (what is the command)?
Any help would be greatly appreciated.:)
Ciao
Sascha
 
Back
Top