Re: randomized order in select? - Mailing list pgsql-sql

From Enver ALTIN
Subject Re: randomized order in select?
Date
Msg-id 1078960521.31720.1.camel@enver.office.frontsite.com.tr
Whole thread Raw
In response to Re: randomized order in select?  (Bruno Wolff III <bruno@wolff.to>)
List pgsql-sql
On Wed, 2004-03-10 at 13:02 -0600, Bruno Wolff III wrote:
> You can but it won't be very efficient (for large tables) as it will generate
> a random ordering for the whole table, probably do a sort and then return the
> first record.  The only thing different you need to do is add () after random:
> select tiptext from tips order by random() limit 1

Thanks. The whole table consists of about 100 rows and I don't think it
will grow by, even twice. So this fits my needs just well.
-- __________
|          |
|          |  Enver ALTIN (a.k.a. skyblue)
|          |  Software developer, IT consultant
|    FRONT |
|==========|  FrontSITE Bilgi Teknolojisi A.Ş.
|_____SITE_|  http://www.frontsite.com.tr/

pgsql-sql by date:

Previous
From: Richard Grosse
Date:
Subject: Re: Converting query to view - duplicate fields - solved
Next
From: azwa@nc.com.my
Date:
Subject: Re: designer tool connect to PostgreSQL