Ordering 'A', 'B', ..., 'Z', 'AA', 'AB', ... - Mailing list pgsql-general

From Jon Lapham
Subject Ordering 'A', 'B', ..., 'Z', 'AA', 'AB', ...
Date
Msg-id 3C73FD3F.9040105@extracta.com.br
Whole thread Raw
Responses Re: Ordering 'A', 'B', ..., 'Z', 'AA', 'AB', ...
Re: Ordering 'A', 'B', ..., 'Z', 'AA', 'AB', ...
List pgsql-general
Hello folks-

Does anyone have a suggestion on how to order a varchar(2) column
containing values like: 'A', 'B', ..., 'Z', 'AA', 'AB', ...

What I would like to to return the tuples in this order:
A
B
C
...
X
Y
Z
AA
AB
...

Instead of:
A
AA
AB
...
B
BA
BB
...

While I would prefer to do the ordering in SQL, my application is
written perl, so I could always do the ordering perl-ically.

Thanks in advance!

--

-**-*-*---*-*---*-*---*-----*-*-----*---*-*---*-----*-----*-*-----*---
  Jon Lapham
  Extracta Moléculas Naturais, Rio de Janeiro, Brasil
  email: lapham@extracta.com.br      web: http://www.extracta.com.br/
***-*--*----*-------*------------*--------------------*---------------


pgsql-general by date:

Previous
From: "Peter Darley"
Date:
Subject: Re: upgrade to 7.2 & pgdumpall
Next
From: Herbert Liechti
Date:
Subject: Re: Ordering 'A', 'B', ..., 'Z', 'AA', 'AB', ...