Skip to content

Instantly share code, notes, and snippets.

@clebersonfalk
Created April 24, 2019 19:26
Show Gist options
  • Save clebersonfalk/ea9dabd86018eba380a72a50e189fae1 to your computer and use it in GitHub Desktop.
Save clebersonfalk/ea9dabd86018eba380a72a50e189fae1 to your computer and use it in GitHub Desktop.
MySQL Update Join Concat
UPDATE desk_24.fases_processuais fp1
INNER JOIN desk_24.fases_processuais fp2 ON(fp2.id = fp1.id)
SET fp1.resumos = IF(fp2.resumos IS NULL,'13,14,15,16,17,18,19',CONCAT(fp2.resumos, ',13,14,15,16,17,18,19'))
WHERE fp1.id IN(90,91,92);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment