Re: MySQL Select help needed



Hi David,

My concern there is when I get a Postcode that may not have a space delimiter.

Dave.
David Harper wrote:
Dave Brown wrote:

If I have a table that contains the column partpostcode and has these entries,
PE10
PE15
PE1


What I want to do is select those rows where the partpostcode exists in a given parameter,...

i.e something liek.

Select * where partpostcode IS CONTAINED IN "PE10 1AF"


Why not have your Java client code split the postcode e.g. "PE10 1AF" into two parts, "PE10" and "1AF", then look for an exact match to the first part?

British postcodes have a regular structure, so this will always work, and in addition, the prefix part "PE10" always refers to a meaningful geographic region, so it makes sense from this viewpoint too.

David Harper
Cambridge, England

.