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

From: "Dinesh Pandey" <dpandey(at)secf(dot)com>
To: "'Juleni'" <julo(at)opensubsystems(dot)org>, <pgsql-general(at)postgresql(dot)org>
Subject: Re: ORDER BY options (how to order data as AAA, aaa, BBB, bbb, ... ZZZ, zzz)
Date: 2005-05-10 10:10:11
Message-ID: 20050510101342.DC96A53782@svr1.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

SELECT * FROM MY_TABLE ORDER BY LOWER(NAME);

Thanks

Dinesh Pandey

-----Original Message-----
From: pgsql-general-owner(at)postgresql(dot)org
[mailto:pgsql-general-owner(at)postgresql(dot)org] On Behalf Of Julian Legeny
Sent: Tuesday, May 10, 2005 3:12 PM
To: pgsql-general(at)postgresql(dot)org
Subject: [GENERAL] ORDER BY options (how to order data as AAA, aaa, BBB,
bbb, ... ZZZ, zzz)

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

---------------------------(end of broadcast)---------------------------

TIP 4: Don't 'kill -9' the postmaster

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Russell Smith 2005-05-10 10:14:38 Re: ORDER BY options (how to order data as AAA, aaa, BBB, bbb, ... ZZZ, zzz)
Previous Message Vidya 2005-05-10 09:50:23 Re: function call error