Order By Question

Поиск
Список
Период
Сортировка
От Tristan Colson
Тема Order By Question
Дата
Msg-id 3A6CD7E4.8BE6DDC3@pacbell.net
обсуждение исходный текст
Список pgsql-sql
This seems like the answer must be pretty easy, but I can't think of it:

In the following statement:

select field1 from my_table where field2 in (3, 1, 2);

How can I modify this statement so that the record are returned in the
order of first those records having field2 = 3, then field2 = 1, then
field2 = 2.
As it stands, I am getting them returned in the order of the value of
field1.



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

Предыдущее
От: Ian Harding
Дата:
Сообщение: Re: Inserting and incrementing with MAX aggregate
Следующее
От: Michael Davis
Дата:
Сообщение: RE: plpgsql language