MySQL Forums
Forum List  »  Newbie

Re: Initial Caps
Posted by: John Winter
Date: January 31, 2007 08:51AM

Try these queries.

1) For the "John & mary" issue:

UPDATE contacts SET fname = concat(mid(fname, 1, locate('&', fname) + 1), UPPER(mid(fname,locate('&', fname) + 2,1)), mid(fname, locate('&', fname) + 3))
WHERE fname LIKE "%&%"

2) For the middle initial issue:


UPDATE contacts SET fname = concat(mid(fname , 1, locate(' ', fname ) ), UPPER(mid(fname ,locate(' ', fname ) + 1,1)), mid(fname , locate(' ', fname ) + 2))
WHERE fname LIKE "% %"

Options: ReplyQuote


Subject
Written By
Posted
January 30, 2007 02:20PM
January 30, 2007 02:47PM
January 30, 2007 03:16PM
Re: Initial Caps
January 31, 2007 08:51AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.