Re: ORDER BY results - Mailing list pgsql-general

From Tom Lane
Subject Re: ORDER BY results
Date
Msg-id 29176.1127402815@sss.pgh.pa.us
Whole thread Raw
In response to ORDER BY results  (Howard Cole <howardnews@selestial.com>)
List pgsql-general
Howard Cole <howardnews@selestial.com> writes:
> I have a query which presents results sorted using the SQL  "ORDER BY...
> LIMIT". Now my question is...  if the column that the order refers to
> has some repeated data, will the order of results always be the same?

No.  You need to add more columns to the ORDER BY clause to ensure a
unique ordering, if you want to be sure of that.

(For sufficiently small values of "always", such as if the table hasn't
been updated in between, the results may appear stable ... but it's not
guaranteed.)

            regards, tom lane

pgsql-general by date:

Previous
From: Michael Fuhr
Date:
Subject: Re: ORDER BY results
Next
From: Tom Lane
Date:
Subject: Re: wrong protocol sequence?