Re: numeric SORT order

Поиск
Список
Период
Сортировка
Искать
От
Doug McNaught
Тема
Re: numeric SORT order
Дата
Msg-id
m3y9ih6uaj.fsf@varsoon.denali.to
Список
Дерево обсуждения
Re: numeric SORT order Ben Ausden <benedict@navyblue.com>
Re: numeric SORT order Jeff Eckermann <jeff_eckermann@yahoo.com>
Ben Ausden  writes:

> thanks Mitch.
> the problem is that casting to int won't work for non-numeric data
> (obviously), and I can't guarantee that values in this column will
> definitely be numeric... I should have made that clearer in my post. Ideally
> I'd like to sort numbers in numeric order and text in regular alphabetic
> order, like: 1,2,3,40,50,a,b,c,d,e...[etc]

Then you'll need to write a custom comparison operator and do 
"ORDER BY ... USING my_op".

-Doug
-- 
Let us cross over the river, and rest under the shade of the trees.
   --T. J. Jackson, 1863
В списке pgsql-general по дате отправления
От: Jeff Eckermann
Дата:
Сообщение: Re: numeric SORT order
От: Peter Darley
Дата:
FAQ