Re: ORDER BY options (how to order data as AAA, aaa, BBB, bbb, ... ZZZ, zzz)

Поиск
Список
Период
Сортировка
От Russell Smith
Тема Re: ORDER BY options (how to order data as AAA, aaa, BBB, bbb, ... ZZZ, zzz)
Дата
Msg-id 200505102014.38203.mr-russ@pws.com.au
обсуждение исходный текст
Ответ на ORDER BY options (how to order data as AAA, aaa, BBB, bbb, ... ZZZ, zzz)  (Julian Legeny <julo@opensubsystems.org>)
Ответы Re: ORDER BY options (how to order data as AAA, aaa, BBB, bbb, ... ZZZ, zzz)  (Julian Legeny <julo@opensubsystems.org>)
Список pgsql-general
On Tue, 10 May 2005 07:41 pm, Julian Legeny wrote:
> Hello,
>
>    I have following problem:

> But I would like to sort all data as following:
>
>    NAME
> -----------
>    AAA
>    aaa
>    BBB
>    bbb
>    CCC
>    ccc
>
>
> How can I write sql command (or set up ORDER BY options) for selecting that?
>
SELECT * FROM MY_TABLE ORDER BY lower(NAME), NAME

The second NAME is to ensure that AAA comes before aaa, otherwise the order is undetermined.

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

Предыдущее
От: "Dinesh Pandey"
Дата:
Сообщение: Re: ORDER BY options (how to order data as AAA, aaa, BBB, bbb, ... ZZZ, zzz)
Следующее
От: "Sim Zacks"
Дата:
Сообщение: Re: ORDER BY options (how to order data as AAA, aaa, BBB, bbb, ... ZZZ, zzz)