RE: partial string extraction with sql using regexp ?

2007-06-13 Thread Christian Hansel
>I'ld like to accomplish something like: > >set @myvar=concat_ws(",",(SELECT column from table1 order by column; >where ...)) > >or > >select concat_ws(",",(SELECT column from table1 order by column where ...)); > >for further usage in sql-scripts I forgot to mention: As I need it in a function

partial string extraction with sql using regexp ?

2007-06-13 Thread Christian Hansel
hi all, Here's a nut to crack: I would like to extract a part of a string stored in a varchar column in a mysql table. Since the part of string I want to extract is neither at a fixed position nor logically separated by a fixed character I was thinking using regexp would by a good idea S

partial string extraction with sql using regexp ?

2007-06-13 Thread Christian Hansel
hi all, Here's a nut to crack: I would like to extract a part of a string stored in a varchar column in a mysql table. Since the part of string I want to extract is neither at a fixed position nor logically separated by a fixed character I was thinking using regexp would by a good idea S

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
<[EMAIL PROTECTED]Subject: Using REGEXP

Using REGEXP

2004-06-29 Thread zzapper
Hi, select * from ytbl_development as t1 where (t1.txtDevPostCode REGEXP "^[[:alpha:]]{1,2}[[:digit:]]{1,2}[[:alpha:]]{0,1}" in #QuotedValueList(qryRadius.shortpostcode)#) The above Where clause doesn't work , it just seems you can't use REGEXP this way qryRadius.shortpostcode contains a list o

Using REGEXP

2004-06-29 Thread zzapper
Hi, select * from ytbl_development as t1 where (t1.txtDevPostCode REGEXP "^[[:alpha:]]{1,2}[[:digit:]]{1,2}[[:alpha:]]{0,1}" in #QuotedValueList(qryRadius.shortpostcode)#) The above Where clause doesn't work , it just seems you can't use REGEXP this way qryRadius.shortpostcode contains a list o

Re: query question using REGEXP

2004-03-17 Thread Michael Stassen
something like this: ... WHERE CONCAT(',', Column, ',') LIKE '%,2,%' to search for rows that contain 2. Hope that helps. Matt - Original Message - From: "award" Sent: Saturday, March 13, 2004 2:16 PM Subject: query question using REGEXP Hi, I&#

Re: query question using REGEXP

2004-03-13 Thread Matt W
umber, then the query I gave will work fine for that because it adds a comma to the beginning and end of the column (with CONCAT()) before doing the LIKE comparison. Matt - Original Message - From: "award" Sent: Saturday, March 13, 2004 5:10 PM Subject: RE: query question using REG

Re: query question using REGEXP

2004-03-13 Thread Matt W
turday, March 13, 2004 2:16 PM Subject: query question using REGEXP > Hi, > > I'm storing in a database numbers separated by comma if more than one > number i.e > Record # Column > 112 > 2

query question using REGEXP

2004-03-13 Thread award
Hi, I'm storing in a database numbers separated by comma if more than one number i.e Record # Column 112 21,2,5,6 31,12,24,45 4 2

Re: select using regexp

2002-11-04 Thread Joseph Bueno
> > > > --- > > Excellence in internet and open source software > > --- > > Sunmaia > > Birmingham > > UK > > www.sunmaia.net > > tel. 0121-242-1473 > > International +44-121-242-1473 > > -

Re: select using regexp

2002-11-04 Thread gerald_clark
- Excellence in internet and open source software --- Sunmaia Birmingham UK www.sunmaia.net tel. 0121-242-1473 International +44-121-242-1473 --- -Original Message- From: Mark Goodge [mailto:mark@;good-stuff.co.uk] Sent: 04 Novem

RE: select using regexp

2002-11-04 Thread Peter Lovatt
f.co.uk] Sent: 04 November 2002 11:21 To: [EMAIL PROTECTED] Subject: select using regexp Hi, I've got a problem that I'm hoping someone can help with. I need to do a query against a text column in order to extract entries that will match whole words only - for example, a search for "cat&q

RE: select using regexp

2002-11-04 Thread Andy Eastham
IL PROTECTED] > Subject: select using regexp > > > Hi, > > I've got a problem that I'm hoping someone can help with. I need to do > a query against a text column in order to extract entries that will > match whole words only - for example, a search for "cat" sh

select using regexp

2002-11-04 Thread Mark Goodge
Hi, I've got a problem that I'm hoping someone can help with. I need to do a query against a text column in order to extract entries that will match whole words only - for example, a search for "cat" should match any of: The cat sat on the mat It was a large cat. Cat food is interesting.