Re: please need help: alpha numeric sorting

Поиск
Список
Период
Сортировка
От Ludwig Lim
Тема Re: please need help: alpha numeric sorting
Дата
Msg-id 20020802093113.38663.qmail@web40006.mail.yahoo.com
обсуждение исходный текст
Ответ на Re: please need help: alpha numeric sorting  ("Duncan Adams (DNS)" <duncan.adams@vcontractor.co.za>)
Список pgsql-novice
--- "Duncan Adams  (DNS)"
<duncan.adams@vcontractor.co.za> wrote:
> u could try
>
> select <field1> || '.' || <field2> as foo from bar
>
> all though that still leaves me stuck.

-what about
select <field1> || '.' || <field2> as foo
from bar
order by to_number(<field1>,'9999'),
to_number(<field2>,'9999');

Assuming that both <field1> and <field2> are
alphanumeric characters. This forces numeric sorting
by converting <field1> and <field2> to numbers.

ludwig.



__________________________________________________
Do You Yahoo!?
Yahoo! Health - Feel better, live better
http://health.yahoo.com

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

Предыдущее
От: "Markus Wollny"
Дата:
Сообщение: Re: please need help: alpha numeric sorting
Следующее
От: Oliver Elphick
Дата:
Сообщение: Re: please need help: alpha numeric sorting