Thanks for the reply. I agree on the scripting languages. However it was a one
time conversion problem. I managed with the substring_index sugestion.
Regards,
Mike
On Wednesday 11 December 2002 02:05, Robert Citek wrote:
Hello Mike,
The short answer: use Perl, Python, Ruby, etc.
You are
Hi,
In one of my tables I have a column which contains a combination of a string
(characters only), a space and a 1 or 2 letter combination. The string has no
fixed lenght. Like:
abcd ef
bcdefgh i
etc
Now I want to remove the 1 or 2 letter combination from this column into
another
Look up SUBSTRING_INDEX in the mysql manual.
select SUBSTRING_INDEX(colX,' ',-1) from table
is what I think you want. This will return everything after the first
space found. May want to stick an if(...) construct in there for where
you don't want the rows without the spaces (see below).
Then
Hello Mike,
The short answer: use Perl, Python, Ruby, etc.
You are pressing the boundaries between a query language (SQL) and a
programming/scripting language (Perl, Python, Ruby, etc.). Scripting
languages as these already have those capabilities and can easily connect
to MySQL an many other