Re: Ordering Results by a Supplied Order

From: Vik Fearing <vik(dot)fearing(at)dalibo(dot)com>
To: Rémi Cura <remi(dot)cura(at)gmail(dot)com>
Cc: Michael Sacket <msacket(at)gammastream(dot)com>, PG-General Mailing List <pgsql-general(at)postgresql(dot)org>
Subject: Re: Ordering Results by a Supplied Order
Date: 2014-02-06 09:55:24
Message-ID: 52F35C0C.9060201@dalibo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 02/06/2014 10:00 AM, Rémi Cura wrote:
> Hey,
> I don"t understand the difference between this ORDINALITY option and
> adding a "row_number() over()" in the SELECT.

WITH ORDINALITY will give you something to order by. You should never
do "row_number() over ()" because that will give you potentially random
results.

--
Vik

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message mephysto 2014-02-06 10:11:46 Re: Temporary table already exists
Previous Message Rémi Cura 2014-02-06 09:07:18 Re: Hard upgrade (everything)