: Mysql List
Subject: RE: RE - Order By Problem
On Tue, 8 Jun 2004, Andy Eastham wrote:
Look at using the Reverse() function, then take the substring up to the
first space, then reverse the result.
Well, 'select substring_index(surname,' ',-1) from advisers' does the
trick as far
- Order By Problem
I have never done anything like this but after looking at the spec's I
have a possible direction for you
In String functions there is LOCATE(substr,str,pos)
The first syntax returns the position of the first occurrence of substring
substr in string str. The second syntax
andy thomas wrote:
snip
Well, this was fixed in the end by this query:
select substring_index(surname,' ',-1) as r from advisers order by r
which produced the desired result. But we have since had complaints from
individuals wanting their surnames sorted differently! People from Germany
with
On Tue, 8 Jun 2004, Paul McNeil wrote:
I have never done anything like this but after looking at the spec's I have
a possible direction for you
In String functions there is
LOCATE(substr,str,pos)
The first syntax returns the position of the first occurrence of substring
substr in
If surname is a field, then use it without the single quotes ('),
otherwise it is treated as a literal string and 0 is the correct result:
select locate(' ',surname,1) from advisers
andy thomas wrote:
Yes, this is the approach I was thinking of using but:
select locate('
On Tue, 8 Jun 2004, Vadim P. wrote:
If surname is a field, then use it without the single quotes ('),
otherwise it is treated as a literal string and 0 is the correct result:
select locate(' ',surname,1) from advisers
Thanks a lot, this is working. I now need to figure out how to use
Look at using the Reverse() function, then take the substring up to the
first space, then reverse the result.
Andy
-Original Message-
From: Paul McNeil [mailto:[EMAIL PROTECTED]
Sent: 08 June 2004 14:04
To: [EMAIL PROTECTED]
Subject: RE - Order By Problem
I have never done
PROTECTED]
Sent: 08 June 2004 14:04
To: [EMAIL PROTECTED]
Subject: RE - Order By Problem
I have never done anything like this but after looking at the spec's I
have
a possible direction for you
In String functions there is
LOCATE(substr,str,pos)
The first syntax returns
Andy,
Just:
select substring_index(surname,' ',-1) as r from advisers order by r;
works.
Andy
-Original Message-
From: andy thomas [mailto:[EMAIL PROTECTED]
Sent: 08 June 2004 15:57
To: Andy Eastham
Cc: Mysql List
Subject: RE: RE - Order By Problem
On Tue, 8 Jun 2004, Andy
work?
Thanks for your help,
Andy
-Original Message-
From: Paul McNeil [mailto:[EMAIL PROTECTED]
Sent: 08 June 2004 14:04
To: [EMAIL PROTECTED]
Subject: RE - Order By Problem
I have never done anything like this but after looking at the spec's I
have a possible direction for you
In String
10 matches
Mail list logo