Re: please need help: alpha numeric sorting - Mailing list pgsql-novice

From Ludwig Lim
Subject Re: please need help: alpha numeric sorting
Date
Msg-id 20020802093113.38663.qmail@web40006.mail.yahoo.com
Whole thread Raw
In response to Re: please need help: alpha numeric sorting  ("Duncan Adams (DNS)" <duncan.adams@vcontractor.co.za>)
List 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 by date:

Previous
From: "Markus Wollny"
Date:
Subject: Re: please need help: alpha numeric sorting
Next
From: Oliver Elphick
Date:
Subject: Re: please need help: alpha numeric sorting