Re: order by

Поиск
Список
Период
Сортировка
От Christoph Haller
Тема Re: order by
Дата
Msg-id 200205141158.NAA00136@rodos
обсуждение исходный текст
Ответ на order by  (Mathieu Arnold <mat@mat.cc>)
Список pgsql-sql
Try 
select * from a order by 3,1,2; 
Regards, Christoph
> 
> Hi
> 
> I have :
> 
> table a (int, varchar, int)
> 
> 1 | one   | 1
> 2 | two   | 3
> 3 | three | 2
> 4 | four  | 3
> 5 | five  | 2
> 
> And I would like to select it and sort it so that the 3rd field is first 2, 
> then 1 and then 3. so that the result should be :
> 
> 1 | one   | 1
> 3 | three | 2
> 5 | five  | 2
> 2 | two   | 3
> 4 | four  | 3
> 
> How could I do that ?
> 
> -- 
> Mathieu Arnold
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Don't 'kill -9' the postmaster
> 



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

Предыдущее
От: Mathieu Arnold
Дата:
Сообщение: order by
Следующее
От: "Marin Dimitrov"
Дата:
Сообщение: Re: order by