Skip to content

Instantly share code, notes, and snippets.

@ivanarrizabalaga
Created September 26, 2014 10:33
Show Gist options
  • Save ivanarrizabalaga/04cfd497ce7e87c1a938 to your computer and use it in GitHub Desktop.
Save ivanarrizabalaga/04cfd497ce7e87c1a938 to your computer and use it in GitHub Desktop.
Updating a column with a random codified value
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;
@cbl176
Copy link

cbl176 commented Sep 26, 2014

,,,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment