>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
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
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
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
Sent by: newsFax to:
<[EMAIL PROTECTED]Subject: Re: Using REGEXP
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
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
<[EMAIL PROTECTED]To: [EMAIL PROTECTED]
>cc:
Sent by: newsFax to:
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
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
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
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
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
<[EMAIL PROTECTED]Subject: Using REGEXP
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
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
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
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
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
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
> >
> > ---
> > Excellence in internet and open source software
> > ---
> > Sunmaia
> > Birmingham
> > UK
> > www.sunmaia.net
> > tel. 0121-242-1473
> > International +44-121-242-1473
> > -
-
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
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
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
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.
25 matches
Mail list logo