mysql - Update table with random values from given set of string values -
mysql - Update table with random values from given set of string values -
i want update table random values given set, not table.
e.g. value1, value2, value3
and mysql query should update records above values.
i looking similar type of solution random string values given set: update column random value
use floor(rand()*3)
generate random number among 0, 1, , 2, utilize case when
assign value
update test set = (case floor(rand()*3) when 0 0 when 1 10 when 2 20 end);
fiddle
mysql random
Comments
Post a Comment