Ew! Each row in your data set should contain a UNIQUE_ID (called various things in different DBengines). That's what you want to clean up first. using that, you might allow the user to be able to refine his search. next, you'll want to think about exactly what it is you want. If you say that you want a unique answer, then just grab the first one you want and ignore the others. of course, if you respond to the user with only one, it may be the wrong one. The current design of your database makes it very inefficient in a search for an address (dbload- going up?) I guess your solution is the best for the situation, though, either perl or the dbengine is going be doing lots of busywork since you have a poorly designed db!