Move "The" to the end of a column
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
UPDATE games | |
SET title = CASE WHEN INSTR(title,' ')>0 | |
AND LEFT(title,INSTR(title,' ')) | |
IN ('The ') | |
THEN CONCAT(UPPER(SUBSTRING(title,INSTR(title,' ')+1,1)) | |
,SUBSTRING(title,INSTR(title,' ')+2) | |
, ', ' | |
, LEFT(title,INSTR(title,' ')-1)) | |
ELSE title | |
END |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment