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

From: "Sim Zacks" <sim(at)compulab(dot)co(dot)il>
To: 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 11:12:47
Message-ID: d5q1iu$e05$1@news.hub.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

if you order by upper(name) then it will mix them all together, so you won't
have capital before lowercase, but it will put all the lowercase a before
the uppercase b

"Julian Legeny" <julo(at)opensubsystems(dot)org> wrote in message
news:559596967(dot)20050510114150(at)opensubsystems(dot)org(dot)(dot)(dot)
> 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 Daniel Schuchardt 2005-05-10 12:14:26 Re: Adventures in Quest for GUI RAD
Previous Message joffer 2005-05-10 10:43:29 unsuscribe