limitby without orderby

From: Rohan Malhotra <yourbuddyrohan(at)gmail(dot)com>
To: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: limitby without orderby
Date: 2011-09-22 11:32:16
Message-ID: CAEoM48VWWmaTUf9JihdYAvOO+gt8M_TydMErdTGaXfhOfa=M=Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi Gurus,

What is difference between

select * from items order by random() limit 5;

and

select * items limit 5;

my basic requirement is to get random rows from a table, my where clause
will make sure I won't get same rows in repeated execution of above queries.

--
Regards

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Oliver Kohll - Mailing Lists 2011-09-22 11:43:28 Re: Random multiple times
Previous Message Rafal Pietrak 2011-09-22 10:28:39 why VOLATILE attribute is required?