Created
September 26, 2014 10:33
-
-
Save ivanarrizabalaga/04cfd497ce7e87c1a938 to your computer and use it in GitHub Desktop.
Updating a column with a random codified value
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 `datamart`.`mytable` | |
set | |
mycolumn = case (FLOOR(1 + RAND() * 5)) | |
when 1 then 'SOME' | |
when 2 then 'RANDOM' | |
when 3 then 'STUFF' | |
when 4 then 'RIGHT' | |
when 5 then 'HERE' | |
end; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
,,,