Re: Custom sort

Поиск
Список
Период
Сортировка
От Craig Ringer
Тема Re: Custom sort
Дата
Msg-id 48A4E2E1.8010402@postnewspapers.com.au
обсуждение исходный текст
Ответ на Custom sort  (Artacus <artacus@comcast.net>)
Список pgsql-general
Artacus wrote:
> Can you define a custom sort in postgres? For instance in mysql, you
> could do something like (I forget the exact syntax)
>
> ORDER BY FIND_IN_SET(column_name, ('one','two','three'))

The simplest direct mapping would probably be a CASE statement (see the
PostgreSQL documentation). As others have noted, enums and Pl/PgSQL
functions are also options.

--
Craig Ringer

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

Предыдущее
От: Hui Xie
Дата:
Сообщение: Re: Query help
Следующее
От: Andrew Sullivan
Дата:
Сообщение: Re: [Q] DNS(bind) ER model