select a random record

From: bj(at)zuto(dot)de (Rainer Clasen)
To: pgsql-general(at)postgresql(dot)org
Subject: select a random record
Date: 2001-09-01 06:57:50
Message-ID: 20010901085750.C18947@zuto.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi!

I'm currently thinking about building a completely database driven
jukebox. It will integrate with an already existing (well kind of) library
for my music files (and more).

This jukebox should offer a random play mode. It should take into account
when the title was played the last time. My Idea is to submit the query
returning the records ordered by their last time of play, ignore a random
number of records, fetch one record and drop the result set.

I'm wondering wether there is a more elegant way to fetch a random record
from a result.

Rainer

--
KeyID=759975BD fingerprint=887A 4BE3 6AB7 EE3C 4AE0 B0E1 0556 E25A 7599 75BD

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Andre Schnabel 2001-09-01 07:07:04 Re: select a random record
Previous Message Andre Schnabel 2001-09-01 06:39:03 Re: PgAdmin question - superuser