I have a column called date_created
and I want each row to hold a random date with a date margin of -2 days from the current time.
I am running the below query but it updates all the rows with the same random date. I want every row to be random and not the same.
update table set date_created=(select NOW() + (random() * (NOW()+'-2 days' - NOW())) + '-2 days')
Any idea would be appreciated.