The title is pretty much explicit, my question is if i get two dates with hour:
Is it possible to pick a random datetime between these two datetime ?
I tried with the random() function but i don't really get how to use it with datetime
Thanks
Matthiew
You can do almost everything with the date/time operators:
select timestamp '2014-01-10 20:00:00' + random() * (timestamp '2014-01-20 20:00:00' - timestamp '2014-01-10 10:00:00')
1.4m articles
1.4m replys
5 comments
56.9k users