please need help: alpha numeric sorting

From: "Raouf" <aimeur(at)prodigy(dot)net>
To: <pgsql-novice(at)postgresql(dot)org>
Subject: please need help: alpha numeric sorting
Date: 2002-08-02 08:48:52
Message-ID: 000f01c23a01$6f17bc40$0201a8c0@pavilion
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Hi Gurus,

I need your help for this one:

let's say I have 1 field of type VARCHAR that contains numbers (as ascii) and characters like this:

title
-----------
12.1 cisco ccnp routing
12.2 cisco ccnp remote access
12.11cisco ccnp switching
12.3 cisco ccnp support

I'd like to sort that column in alphanumeric order, like this:

title
-----------
12.1 cisco ccnp routing
12.2 cisco ccnp remote access
12.3 cisco ccnp support
12.11cisco ccnp switching

but if I sort using group by title and order by title asc I have:


title
-----------
12.1 cisco ccnp routing
12.11cisco ccnp switching
12.2 cisco ccnp remote access
12.3 cisco ccnp support
12.11cisco ccnp switching

where "12.11cisco ccnp switching" is before "12.2 cisco ccnp remote access" because it is smaller.

Is it possible ?

thanks for your help

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Markus Wollny 2002-08-02 08:56:10 Re: please need help: alpha numeric sorting
Previous Message Andrew Sher 2002-08-01 16:24:20 passing parameters to views (or alternative methods)?