Re: Lexical question...

From: Michael Fuhr <mike(at)fuhr(dot)org>
To: John DeSoi <desoi(at)pgedit(dot)com>
Cc: Net Virtual Mailing Lists <mailinglists(at)net-virtual(dot)com>, Pgsql General <pgsql-general(at)postgresql(dot)org>
Subject: Re: Lexical question...
Date: 2004-11-23 16:12:10
Message-ID: 20041123161210.GA33539@winnie.fuhr.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Tue, Nov 23, 2004 at 09:03:26AM -0500, John DeSoi wrote:

> select now() - ((round(random()*45))::text || ' days')::interval;

Or one of the following (add round() if desired):

select now() - 45 * random() * interval'1 day';
select now() - random() * interval'45 day';

--
Michael Fuhr
http://www.fuhr.org/~mfuhr/

In response to

Browse pgsql-general by date

  From Date Subject
Next Message phil campaigne 2004-11-23 16:15:13 null value of type java.sql.Time
Previous Message Michael Fuhr 2004-11-23 16:04:02 Re: Will B4->B5 require an Initdb?