ORDER BY a string

Started by phazonover 18 years ago2 messagesgeneral
Jump to latest
#1phazon
phazon.ml@gmail.com

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

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: phazon (#1)
Re: ORDER BY a string

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