Skip to content

Instantly share code, notes, and snippets.

@ArneAnka
Created July 29, 2020 06:14
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Embed
What would you like to do?
Move "The" to the end of a column
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