mysql中使用update set指定字段为随机数 sql语句 sql语句 update `表名` set `字段名`=ceiling(rand()*10+1) where (条件); update `表名` set click=click*0.01 where qipa='250' and click>250 将产生1-10之间的带小数的数字,可以使用ceil进行转换。 update `t` set col=FLOOR(RAND()*250+1)--取1-250的随机数