Обсуждение: ORDER BY a string

Поиск
Список
Период
Сортировка

ORDER BY a string

От
phazon
Дата:
Hi,

I've to order by q query by a column.

SELECT a.id, a.nom
FROM table a
ORDER BY a.nom;

And i've something strange. It's order like that:

5   | aaaa
8   | aaab
15 | ** aaac
6   | aaad

I've "**" before the name in order to display them at first, but the 2
chars "**" are ignored in the order by.


Can anyone explain me why ?


PS: Sorry for my bad english, i'm french.

--
phazon

Re: ORDER BY a string

От
Tom Lane
Дата:
phazon <phazon.ml@gmail.com> writes:
> I've "**" before the name in order to display them at first, but the 2
> chars "**" are ignored in the order by.

What's your lc_collate setting?  In locales other than "C" this is not
at all unexpected.

            regards, tom lane