View Single Post
  #1   IP: 112.87.30.158
Old 2015-04-19, 06:17 AM
Illiopolis Illiopolis is offline
初级会员
 
Join Date: 2006-09-30
Posts: 1
Illiopolis 现在声名狼藉
Default Insert/ Update random date in MySQL

How would I update a column with a random date in the past 2 weeks using MySQL?

For example (code doesn't actually work):
Code:
UPDATE mytable
SET col = sysdate()-rand(1,14);
Reply With Quote