Re: ORDER BY results

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Howard Cole <howardnews(at)selestial(dot)com>
Cc: "'PgSql General'" <pgsql-general(at)postgresql(dot)org>
Subject: Re: ORDER BY results
Date: 2005-09-22 15:26:55
Message-ID: 29176.1127402815@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Howard Cole <howardnews(at)selestial(dot)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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Guy Fraser 2005-09-22 15:31:00 Re: array_dims array_lower/upper distance
Previous Message Michael Fuhr 2005-09-22 15:17:01 Re: ORDER BY results