With SQL , Can I insert random datetime values in a column giving a range?
For example, given a range of 2010-04-30 14:53:27 to 2012-04-30 14:53:2
2010-04-30 14:53:27
2012-04-30 14:53:2
This worked for me but my issue was a bit different. I had to assign certain values in a column to a random datetime.
UPDATE Tablename SET columnName = addtime(concat_ws(' ','2018-07-25' + interval rand()*2 day ,'00:00:00'),sec_to_time(floor(0 + (rand() * 86401)))) WHERE columnName = condition;