Wednesday, 25 April 2018

Update Date Column With RANDOM date in PostgreSQL



Random Dates and Numbers in PostgreSQL with the RANDOM() Function



select NOW() + (random() * (NOW()+'90 days' - NOW())) + '30 days';

UPDATE stock SET trans_date = NOW() + (random() * (NOW()+'90 days' - NOW())) + '30 days';



No comments:

Post a Comment