首页 > 技术文章 > sql随机时间与随机数

michaelcnblogs 2020-04-20 05:41 原文

update mto_post set author_id = floor(10+rand()*10)
update mto_post t
set
t.created = concat('2019-',floor(1+rand()*10),'-',floor(rand()*3), floor(1+rand()*3),' ', floor(10+rand()*10),':',floor(10+rand()*49),':',floor(10+rand()*49));

推荐阅读