Re: Selecting a random row

From: Holger Klawitter <lists(at)klawitter(dot)de>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Selecting a random row
Date: 2004-11-04 12:55:28
Message-ID: 200411041355.33916.lists@klawitter.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Thursday 04 November 2004 12:36, Kari Lavikka wrote:
> Is there any explanation for this strange behavior or are there better
> ways to select a random row?

How about

SELECT ...whatever... ORDER BY random() LIMIT 1;

Mit freundlichem Gruß / With kind regards
Holger Klawitter
- --
lists <at> klawitter <dot> de
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.2 (GNU/Linux)

iD8DBQFBiibF1Xdt0HKSwgYRAlJXAJ4nUpDfKBKCigPVMt8WpKG4gZmt4wCcD/ZC
KHBlBl1+5FZ4pgqkZlyzWQA=
=MrrE
-----END PGP SIGNATURE-----

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Martin Foster 2004-11-04 13:10:38 Re: Restricting Postgres
Previous Message Simon Riggs 2004-11-04 12:19:00 Re: Restricting Postgres