Re: Ordering Results by a Supplied Order - Mailing list pgsql-general

From Sergey Konoplev
Subject Re: Ordering Results by a Supplied Order
Date
Msg-id CAL_0b1tV16zvp7YNczL08p=Rxp99TFkb9iYCfzSSGstmHACqDw@mail.gmail.com
Whole thread Raw
In response to Ordering Results by a Supplied Order  (Michael Sacket <msacket@gammastream.com>)
List pgsql-general
On Wed, Feb 5, 2014 at 7:16 PM, Michael Sacket <msacket@gammastream.com> wrote:
> Often times I find it necessary to work with table rows in a specific,
> generally user-supplied order.  It could be anything really that requires an
> ordering that can't come from a natural column.  Most of the time this
> involved manipulating a position column from the client application.  In any
> case, I've often found that to be cumbersome, but I think I've come up with
> a solution that some of you may find useful.

There also are some ways of doing it without creating an additional
column http://www.depesz.com/2010/07/25/how-to-order-by-some-random-query-defined-values/.

--
Kind regards,
Sergey Konoplev
PostgreSQL Consultant and DBA

http://www.linkedin.com/in/grayhemp
+1 (415) 867-9984, +7 (901) 903-0499, +7 (988) 888-1979
gray.ru@gmail.com


pgsql-general by date:

Previous
From: alexandros_e
Date:
Subject: Re: Postgresql GROUP BY "SIMILAR" but not equal values
Next
From: Michael Sacket
Date:
Subject: Re: Ordering Results by a Supplied Order