ORDER BY options (how to order data as AAA, aaa, BBB, bbb, ... ZZZ, zzz)

From: Julian Legeny <julo(at)opensubsystems(dot)org>
To: pgsql-general(at)postgresql(dot)org
Subject: ORDER BY options (how to order data as AAA, aaa, BBB, bbb, ... ZZZ, zzz)
Date: 2005-05-10 09:41:50
Message-ID: 559596967.20050510114150@opensubsystems.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hello,

I have following problem:

I have table MY_TABLE with following records:

NAME
-----------
ccc
CCC
AAA
aaa
bbb
BBB

When I use default select that sort all data by NAME:

SELECT * FROM MY_TABLE ORDER BY NAME;

result is following:

NAME
-----------
AAA
BBB
CCC
aaa
bbb
ccc

But I would like to sort all data as following:

NAME
-----------
AAA
aaa
BBB
bbb
CCC
ccc

How can I write sql command (or set up ORDER BY options) for selecting that?


Thank you in advance for answer,
best regards,

Julian Legeny

mailto:julo(at)opensubsystems(dot)org

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Sim Zacks 2005-05-10 09:44:41 Re: function call error
Previous Message Sim Zacks 2005-05-10 09:37:50 alter views