sql 随机取指定范围内的值

SELECT Fdatetime, CONVERT(datetime, CONVERT(char(10), Fdatetime, 120) + ' ' + CONVERT(char(12), time1), 20)
AS newdatetime, time1, DATEADD(mi, - FLOOR(RAND(ABS(CHECKSUM(NEWID()))) * 15), CONVERT(datetime,
CONVERT(char(10), Fdatetime, 120) + ' ' + CONVERT(char(12), time1), 20)) AS testDatetime
FROM test

posted @ 2019-06-22 11:46  学习是进步的阶梯  阅读(855)  评论(0编辑  收藏  举报