Skip site navigation (1) Skip section navigation (2)

Selecting random rows using weights

From: "G" <gerard(at)interfold(dot)com>
To: <pgsql-novice(at)postgresql(dot)org>
Subject: Selecting random rows using weights
Date: 2002-05-12 19:24:17
Message-ID: ILEPLGCLIJOCNINEJCJPIELNDJAA.gerard@interfold.com (view raw or flat)
Thread:
Lists: pgsql-novice
Is there a way to select rows randomly using weight columns? (weighted
random values)

Thanks,
Gerard


> -----Original Message-----
> From: pgsql-novice-owner(at)postgresql(dot)org
> [mailto:pgsql-novice-owner(at)postgresql(dot)org]On Behalf Of Doug Silver
> Sent: Thursday, May 09, 2002 6:26 PM
> To: pgsql-novice(at)postgresql(dot)org
> Subject: [NOVICE] Converting epoc number to timestamp
>
>
> Just curious if there's a way in Postgres to take an epoch number (UTC)
> which is stored as a bigint field and convert it to a timestamp.
>
> perl does it like so:
>
> $ perl -e 'print localtime(1020990264)."\n"'
> Thu May  9 17:24:02 2002
>
> Didn't see anything in the stored functions, but wanted to be sure.  If
> not, would it make sense to create my own function that would do it in the
> database or just code it on the front end (i.e. web app)?
>
>  --
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> Doug Silver
> Network Manager
> Urchin Corporation	http://www.urchin.com
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Don't 'kill -9' the postmaster
>


In response to

pgsql-novice by date

Next:From: Joel BurtonDate: 2002-05-12 19:50:50
Subject: Re: newbie: Column CHECK(col contains '@') ?
Previous:From: john-paul delaneyDate: 2002-05-12 19:11:00
Subject: newbie: Column CHECK(col contains '@') ?

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group