Re: Controlling Reuslts with Limit

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Najm Hashmi <najm(at)mondo-live(dot)com>
Cc: pgsql <pgsql-sql(at)postgresql(dot)org>
Subject: Re: Controlling Reuslts with Limit
Date: 2001-02-23 21:18:16
Message-ID: 200102232118.QAA28623@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

> Hi,
> I was reading through Bruce's on line . I found follwing bit unclear...
>
> "Notice that each query uses ORDER BY . Although this clause is not required,
> LIMIT without ORDER BY returns random rows from the query, which would be
> useless. "

It means there is no guarantee which rows will be returned. You may get
the rows you want, or you may not. Without the ORDER BY, the backend
can return any five rows it wishes.

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Bryan White 2001-02-23 21:24:14 Re: Controlling Reuslts with Limit
Previous Message Tom Lane 2001-02-23 21:07:23 Re: select * from pgadmin_users; causes error