Re: Ordering Results by a Supplied Order

Поиск
Список
Период
Сортировка
От Vik Fearing
Тема Re: Ordering Results by a Supplied Order
Дата
Msg-id 52F34667.7090600@dalibo.com
обсуждение исходный текст
Ответ на Ordering Results by a Supplied Order  (Michael Sacket <msacket@gammastream.com>)
Ответы Re: Ordering Results by a Supplied Order  (Rémi Cura <remi.cura@gmail.com>)
Re: Ordering Results by a Supplied Order  (Michael Sacket <msacket@gammastream.com>)
Список pgsql-general
On 02/06/2014 04:16 AM, Michael Sacket 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.  


Up until 9.4, that's a good way to do it.

Starting from 9.4, you can use the WITH ORDINALITY feature.
http://www.postgresql.org/docs/devel/static/sql-select.html
-- 
Vik

В списке pgsql-general по дате отправления:

Предыдущее
От: mephysto
Дата:
Сообщение: Re: Temporary table already exists
Следующее
От: Vik Fearing
Дата:
Сообщение: Re: How to get rid of superfluous WAL segments?