List:General Discussion« Previous MessageNext Message »
From:Martin Ramsch Date:September 8 1999 2:36pm
Subject:split string into parts (was:: Process question)
View as plain text  
On Wed, 1999-09-08 07:54:01 -0600, Michael Adams wrote:
> My biggest problem is that the personnel db has a single field for
> name. I need to be able to break the last name out and display it
> separately.
> 
> Is there a way of doing this in MySQL?

You maybe can do it with SUBSTRING_INDEX:

+------------------------------------------+
| SUBSTRING_INDEX('Martin Ramsch', ' ', 1) |
+------------------------------------------+
| Martin                                   |
+------------------------------------------+
+-------------------------------------------+
| SUBSTRING_INDEX('Martin Ramsch', ' ', -1) |
+-------------------------------------------+
| Ramsch                                    |
+-------------------------------------------+


Monty, did you get my little bug report on SUBSTRING_INDEX?
(concerns only delimiters with more than one character)

Regards,
  Martin
-- 
Martin Ramsch <m.ramsch@stripped> <URL: http://home.pages.de/~ramsch/ >
PGP KeyID=0xE8EF4F75 FiPr=52 44 5E F3 B0 B1 38 26  E4 EC 80 58 7B 31 3A D7
Thread
ipfwadm related questionThijs Cobben8 Sep
  • Re: ipfwadm related questionColin McKinnon8 Sep
    • Process questionMichael Adams8 Sep
      • split string into parts (was:: Process question)Martin Ramsch8 Sep
Re: ipfwadm related questionCurtis Maurand8 Sep
  • Re: ipfwadm related questionVan8 Sep
RE: ipfwadm related questionClinton Gormley8 Sep
  • RE: ipfwadm related questionVan8 Sep