Re: Postal code searching

2012-04-25 Thread Hal�sz S�ndor
2012/04/25 10:14 +0100, Mark Goodge On 24/04/2012 17:24, Tompkins Neil wrote: >How about if I want to only return postal codes that are like W1U 8JE >not W13 0SU. > >Because in this example I have W1 as the postal code and W13 is the other >postal code No, you don't. In this example you

Re: Postal code searching

2012-04-25 Thread Tompkins Neil
Thanks for your very detailed response Mark. Most helpful. On Wed, Apr 25, 2012 at 10:14 AM, Mark Goodge wrote: > On 24/04/2012 17:24, Tompkins Neil wrote: > >> How about if I want to only return postal codes that are like W1U 8JE >> not W13 0SU. >> >> Because in this example I have W1 as the

Re: Postal code searching

2012-04-25 Thread Andrew Moore
If nothing else a great intro to the UK postcode. I find this very interesting/useful. Thanks Mark. On Wed, Apr 25, 2012 at 10:14 AM, Mark Goodge wrote: > On 24/04/2012 17:24, Tompkins Neil wrote: > >> How about if I want to only return postal codes that are like W1U 8JE >> not W13 0SU. >> >> B

Re: Postal code searching

2012-04-25 Thread Mark Goodge
On 24/04/2012 17:24, Tompkins Neil wrote: How about if I want to only return postal codes that are like W1U 8JE not W13 0SU. Because in this example I have W1 as the postal code and W13 is the other postal code No, you don't. In this example you have W1U as one outbound code and W13 as the ot

Re: Postal code searching

2012-04-24 Thread Grant Allen
Original Message- >>> From: Tompkins Neil [mailto:neil.tompk...@googlemail.com] >>> Sent: Tuesday, April 24, 2012 9:11 AM >>> To: [MySQL] >>> Subject: Postal code searching >>> >>> Hi >>> >>> I've a number of differe

Re: Postal code searching

2012-04-24 Thread Neil Tompkins
inguish digits from letters, but won't help you isolate them. > >> -Original Message- >> From: Tompkins Neil [mailto:neil.tompk...@googlemail.com] >> Sent: Tuesday, April 24, 2012 9:11 AM >> To: [MySQL] >> Subject: Postal code searching >> >> Hi >>

RE: Postal code searching

2012-04-24 Thread Rick James
ev.mysql.com/doc/refman/5.0/en/string-functions.html#function_substring-index RLIKE can distinguish digits from letters, but won't help you isolate them. > -Original Message- > From: Tompkins Neil [mailto:neil.tompk...@googlemail.com] > Sent: Tuesday, April 24, 2012

Re: Postal code searching

2012-04-24 Thread Lars Nilsson
On Tue, Apr 24, 2012 at 12:24 PM, Tompkins Neil wrote: > How about if I want to only return postal codes that are like W1U 8JE > not W13 0SU. > > Because in this example I have W1 as the postal code and W13 is the other > postal code Perhaps something like following? Though, to be honest, I'm not

Re: Postal code searching

2012-04-24 Thread Gary Smith
On 24/04/2012 17:24, Tompkins Neil wrote: How about if I want to only return postal codes that are like W1U 8JE not W13 0SU. Because in this example I have W1 as the postal code and W13 is the other postal code Then you'd do: like 'W1 %' to return anything starting W1 like 'W13 %' to return an

Re: Postal code searching

2012-04-24 Thread Tompkins Neil
How about if I want to only return postal codes that are like W1U 8JE not W13 0SU. Because in this example I have W1 as the postal code and W13 is the other postal code On Tue, Apr 24, 2012 at 5:18 PM, Gary Smith wrote: > On 24/04/2012 17:16, Gary Smith wrote: > >> http://dev.mysql.com/doc/**r

Re: Postal code searching

2012-04-24 Thread Gary Smith
On 24/04/2012 17:16, Gary Smith wrote: http://dev.mysql.com/doc/refman/5.0/en/string-comparison-functions.html Specifically, replace % with _ as this means "match one character" not "match any number of characters". So, you can do: like "W1 %" like "W1_ %" etc. Oh, and you can also get really

Re: Postal code searching

2012-04-24 Thread Gary Smith
On 24/04/2012 17:11, Tompkins Neil wrote: Hi I've a number of different postal codes in a system for example WC1B 5JA WC1H 8EJ W1J 7BX W1H 7DL NW1 1NY I can use like statements for example SELECT * FROM postal_codes WHERE zip LIKE 'W1%' giving me W1J 7BX W1H 7DL In addition I have a number

Postal code searching

2012-04-24 Thread Tompkins Neil
Hi I've a number of different postal codes in a system for example WC1B 5JA WC1H 8EJ W1J 7BX W1H 7DL NW1 1NY I can use like statements for example SELECT * FROM postal_codes WHERE zip LIKE 'W1%' giving me W1J 7BX W1H 7DL In addition I have a number of abbreviated postal codes like W1 WC1 WC2