生成随机的时间的SQL


SELECT make_time(floor((random() * 12))::int, floor((random() * 60))::int, floor((random() * 60))::int) AS rand_time;

生成随机的日期的SQL

SELECT current_date - floor((random() * 25))::int

生成随机的年月日时分秒的SQL

SELECT concat(current_date - floor((random() * 25))::int,' ',make_time(floor((random() * 12))::int, floor((random() * 60))::int, floor((random() * 60))::int))

更多推荐