Lexical question...

From: "Net Virtual Mailing Lists" <mailinglists(at)net-virtual(dot)com>
To: "Pgsql General" <pgsql-general(at)postgresql(dot)org>
Subject: Lexical question...
Date: 2004-11-23 10:33:36
Message-ID: 20041123103336.27425@mail.net-virtual.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hello,

I have a table with a timestamp column and I want to set this to a value
of now() - a random number of days between 0 and 45 for each row... I've
tried to do this a bunch of different ways and can't figure it out...
Here is my latest version:

update sometable set entered_dt = now() - interval round(random()*45)||'
days';

Any ideas on the proper way to accomplish this?

Thanks!

- Greg

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Net Virtual Mailing Lists 2004-11-23 10:41:49 Re: null value of type java.sql.Time
Previous Message Karsten Hilbert 2004-11-23 07:55:11 Re: How to handle larger databases?