0
UPDATE engine4_users 
SET displayname = CONCAT(
  UCASE(LEFT(displayname, 1)),
  LCASE(SUBSTRING(displayname, 2, INSTR(displayname, ' ')-1)),
  UCASE(SUBSTRING(displayname, INSTR(displayname, ' ')+1,1)),
  LCASE(SUBSTRING(displayname,INSTR(displayname, ' ')+2))
) 

This is my query but the first two words of a string will be capitalised. More than two words are not possible.

jondinham
  • 8,271
  • 17
  • 80
  • 137
  • 1
    possible duplicate of [MySQL - Capitalize first letter of each word, in existing table](http://stackoverflow.com/questions/3278207/mysql-capitalize-first-letter-of-each-word-in-existing-table) – arunrc Aug 22 '14 at 09:31
  • Jonathan's answer here shows how to split a string of arbitrary length, http://stackoverflow.com/questions/14950466/how-to-split-the-name-string-in-mysql which you could then apply caps too, but arunrc has found an even better link. – John Powell Aug 22 '14 at 09:31
  • This answer is not helpful to this question.I was tryed it. – Teenu Thomas Aug 22 '14 at 09:45

0 Answers0