Created
July 29, 2020 06:14
-
-
Save ArneAnka/1bf5b39cfd208e7c10caf28d17f416cb to your computer and use it in GitHub Desktop.
Move "The" to the end of a column
This file contains hidden or 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