I have a database where a user can search for addresses. However, some addresses in the databases are listed in a range. For example, 120-125 main st can be a record in the database. If the user searches for 123 Main St, is there a way to get the 120-125 record to show up? This needs to be rather dynamic to include all ranges so I’m not sure if the BETWEEN clause will work properly. Any ideas?
Share
Save yourself many, many headaches and make dedicated fields for this kind of data. You might even create a function that parses addresses and fills these fields with the help of a trigger (after insert, update):
Later, you can call them (e.g. in your trigger):
This way you have actual fields that you can use with the BETWEEN operator.