On 10/25/06, Mark <[EMAIL PROTECTED]> wrote:
I have a field called name which stores a person's first, middle and
last name.

Previously, these names (17800 of them) were entered in the database by
different people so there was no consistency in the format used. There
are now names entered such as:

Smith, John S.
Doe - Jane W.
Doe John


What I would like to do is to have a script that can update the database
and make all names appear with a comma separating the last and first
name as shown in the first example: Smith, John S.

The rest of the name format does not matter.

Is this possible and if so, can someone be kind enough to help with such
a script and or point me in the right direction.


As someone already suggested a form of query that can do this and thus
the problem is solved, I would take the time and  convert the "name"
field into 3 fields "first_name", "middle_name", "last_name" to avoid
future problems. You'll get benefits like:

1) Avoid multiple name formats, as it makes it really difficult for a
person to fill a 3 fields form in the wrong way.
2) Can be easily manipulated for various output formats.
3) It is worth the time if you'll constantly add names to the database.

My 2 cents.

--
Daniel da Veiga
Computer Operator - RS - Brazil
-----BEGIN GEEK CODE BLOCK-----
Version: 3.1
GCM/IT/P/O d-? s:- a? C++$ UBLA++ P+ L++ E--- W+++$ N o+ K- w O M- V-
PS PE Y PGP- t+ 5 X+++ R+* tv b+ DI+++ D+ G+ e h+ r+ y++
------END GEEK CODE BLOCK------

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to