Re: Using REGEXP

2004-07-01 Thread zzapper
On 30 Jun 2004 17:45:06 +0200, wrote: >In article <[EMAIL PROTECTED]>, >SGreen writes: > >> SELECT t1.* >> FROM ytbl_development t1 >> INNER JOIN tmpShortCodes sc >> ON INSTR(t1.txtDevPostCode, sc.short_code) =1 > >This is the same as > > SELECT t1.* > FROM ytbl_development t1 > INNER JOIN tmp

Re: Using REGEXP

2004-06-30 Thread SGreen
Sent by: newsFax to: <[EMAIL PROTECTED]Subject: Re: Using REGEXP

Re: Using REGEXP

2004-06-30 Thread Harald Fuchs
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] writes: > SELECT t1.* > FROM ytbl_development t1 > INNER JOIN tmpShortCodes sc > ON INSTR(t1.txtDevPostCode, sc.short_code) =1 This is the same as SELECT t1.* FROM ytbl_development t1 INNER JOIN tmpShortCodes sc ON t1.txtDevPostCode LIKE

Re: Using REGEXP

2004-06-30 Thread Michael Stassen
In all of your examples so far, the short postcode ends with the first character after the space. If that is true for all short postcodes, we could take the portion of the full postcode up to the first character after the space, then compare that to the list. I think that's what you were hopi

Re: Using REGEXP

2004-06-30 Thread SGreen
<[EMAIL PROTECTED]To: [EMAIL PROTECTED] >cc: Sent by: newsFax to:

Re: Using REGEXP

2004-06-30 Thread zzapper
Michael Ignoring my attempt at a query, I'll restate the problem T1.devtxtpostcode contains full UK Postcodes eg OX14 5RA, OX14 5BH, Se1 1AH, etc I want to check if a particular postcode is within a list of postcode areas, these postcode areas are naturally shorter ie ox14 5,ox14 6 etc. So I ne

Re: Using REGEXP

2004-06-29 Thread Michael Stassen
I'm sorry for my overly terse reply. Perhaps I'm being dense, but I just don't get it. Your REGEXP matches a string which starts with 1 or 2 letters, followed by 1 or 2 digits, followed by 0 or 1 letters, which tells me a short postcode would be 'OX14' or 'OX14A', but your example short postcod

Re: Using REGEXP

2004-06-29 Thread Michael Stassen
Then you need to tell us what operation needs to be performed on t1.postcode before making the comparison. That is, describe what you want, rather than what didn't work. Michael zzapper wrote: On Tue, 29 Jun 2004 15:13:10 -0400, wrote: zzapper: I could be reading it wrong, but it looks like y

Re: Using REGEXP

2004-06-29 Thread zzapper
On Tue, 29 Jun 2004 15:13:10 -0400, wrote: >zzapper: > >I could be reading it wrong, but it looks like you're looking for the >result of your REGEXP in a list. REGEXP returns only a 0 or 1, not the >expression resulting from performing a REGEXP. > >Wes > >On Jun 29, 2004, at 9:25 AM, zzapper w

Re: Using REGEXP

2004-06-29 Thread Wesley Furgiuele
zzapper: I could be reading it wrong, but it looks like you're looking for the result of your REGEXP in a list. REGEXP returns only a 0 or 1, not the expression resulting from performing a REGEXP. Wes On Jun 29, 2004, at 9:25 AM, zzapper wrote: Hi, select * from ytbl_development as t1 where (t1

Re: Using REGEXP

2004-06-29 Thread SGreen
A quick review of the REGEXP portion of the manual helped me to understand what went wrong: http://dev.mysql.com/doc/mysql/en/String_comparison_functions.html REGEXP is a comparitor, not a function. It works like "=" or ">" and the result is a boolean value. Were you trying to validate t1.postco