Re: random rows

From: jdassen(at)cistron(dot)nl (J(dot)H(dot)M(dot) Dassen (Ray))
To: pgsql-admin(at)postgresql(dot)org, pgsql-sql(at)postgresql(dot)org
Subject: Re: random rows
Date: 2001-04-26 19:53:32
Message-ID: slrn9egv5s.8mb.jdassen@odin.cistron-office.nl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin pgsql-general pgsql-sql

Jie Liang <jliang(at)ipinc(dot)com> wrote:
>e.g. what my selectee is a set of 1000 rows, I want randomly pickup 100 of
>1000.

Have you tried
SELECT * FROM selectee ORDER BY random() LIMIT 100;
?o

HTH,
Ray
--
<GRub[B]eR> JHM, jij bent echt nerd :))
<GRub[B]eR> maar wel een goeie :)
<GRub[B]eR> Soort van programmerende furby
Gezien op #cistron

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Joel Burton 2001-04-26 20:35:33 Re: random rows
Previous Message Josh Berkus 2001-04-26 19:34:31 Re: random rows

Browse pgsql-general by date

  From Date Subject
Next Message Marko Kreen 2001-04-26 20:03:09 status after 7.1 and pgcrypto update / crypt(table.field) ?
Previous Message Clayton Vernon 2001-04-26 19:51:23 Re: Re: Re: Need for newbie friendly docs (was Newbie struggling...)

Browse pgsql-sql by date

  From Date Subject
Next Message Joel Burton 2001-04-26 20:35:33 Re: random rows
Previous Message Josh Berkus 2001-04-26 19:34:31 Re: random rows