> Is there available a routine, intrinsic or otherwise, that allows for simple
> extraction of one(1) random tuple from a given table or query-result?
> (The specific application I had in mind was drawing a random product from a
> webstore's inventory to feature on a front or section web page).
SELECT tablea.*, random() as random_key
ORDER BY random_key
And you can modify the limit to select as many random rows as you want.
Aglio Database Solutions
In response to
pgsql-novice by date
|Next:||From: Josh Berkus||Date: 2002-10-18 00:08:34|
|Subject: Re: Random tuple?|
|Previous:||From: Randy Neumann||Date: 2002-10-17 20:15:11|
|Subject: Re: char() or varchar() for frequently used column|