创建一个表
CREATE TABLE `money` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`nickname` varchar(30) NOT NULL DEFAULT '' COMMENT '微信昵称',
`headimgurl` varchar(255) CHARACTER SET utf8 NOT NULL DEFAULT '' COMMENT '微信头像地址',
`money` decimal(10,2) NOT NULL DEFAULT '0.00' COMMENT '金额',
`create_time` int(11) DEFAULT NULL COMMENT '创建时间',
PRIMARY KEY (`id`)
)COMMENT='';
通过 指定范围的随机数 round(rand()*(max-min)+min)
SELECT round(rand()*270000);
SELECT FROM_UNIXTIME( (SELECT round(rand()*10) + 11), '%Y-%m-%d %H:%i:%s' )
更新表字段
UPDATE money set create_time = (SELECT round(rand()*10) + 11)
where
id >= '1'
and id <= '10'