Received: from tidal.ipinc.com (tidal.ipinc.com [199.245.188.85]) by postgresql.org (8.11.3/8.11.1) with ESMTP id f3QJU1315961 for ; Thu, 26 Apr 2001 15:30:01 -0400 (EDT) (envelope-from jliang@tidal.ipinc.com) Received: from localhost (jliang@localhost) by tidal.ipinc.com (8.9.3/8.9.3) with ESMTP id MAA81295; Thu, 26 Apr 2001 12:29:22 -0700 (PDT) (envelope-from jliang@tidal.ipinc.com) Date: Thu, 26 Apr 2001 12:29:22 -0700 (PDT) From: Jie Liang To: "Ing. Roberto Andrade Fonseca" cc: pgsql-admin@postgresql.org Subject: Re: random rows In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Archive-Number: 200104/155 X-Sequence-Number: 1295 thanks. Jie LIANG St. Bernard Software 10350 Science Center Drive Suite 100, San Diego, CA 92121 Office:(858)320-4873 jliang@ipinc.com www.stbernard.com www.ipinc.com On Thu, 26 Apr 2001, Ing. Roberto Andrade Fonseca wrote: > On Thu, 26 Apr 2001, Jie Liang wrote: > > > > > How I can return random N rows from my select stmt? > > like: > > e.g. what my selectee is a set of 1000 rows, I want randomly > > pickup 100 of 1000. > > > I've donne something like: > > prereg_iw=# select random(), nombre from asistente order by 1 limit 10; > random | nombre > ----------------------+--------------- > 0.000214523170243261 | ALFONSO > 0.000478655100091666 | OSCAR > 0.000892118085591177 | JOSE LUIS > 0.000972398091560415 | IGNACIO > 0.00109919300354048 | NORBERTO > 0.00180558208460248 | SALVADOR > 0.00196880800741204 | ANDRES NOE > 0.00197171233686233 | SARA MICHELLE > 0.00226354412839913 | DAVID > 0.00233715307076329 | RODOLFO > (10 rows) > > and it works! > > Saludos, > > Roberto Andrade Fonseca > randrade@abl.com.mx >