How can I change the date by the random number of days in PostgreSQL?
Unfortunately Generate a random number in the range 1 - 10 solution with trunc doesn't work:
select date(now()) + (trunc(random() * 20))
results in:
ERROR: operator does not exist: date + double precision
LÍNEA 1: select date(now()) + (trunc(random() * 20))
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With