Mysql根据时间戳按小时每小时统计 select FROM_UNIXTIME(time,'%Y-%m-%d %H:00:00') as time from tableName ORDER BY time 更新表中某个字段为随机整数 update tableName set platform_id = FLOOR(RAND()*3+1),count = FLOOR(RAND()*100+1) sql取随机两位小数 select ROUND(RAND()*3+1,2)