Search Postgresql Archives

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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



SELECT * FROM MY_TABLE ORDER BY LOWER(NAME);

 

 

Thanks

Dinesh Pandey

 

-----Original Message-----
From: pgsql-general-owner@xxxxxxxxxxxxxx [mailto:pgsql-general-owner@xxxxxxxxxxxxxx] On Behalf Of Julian Legeny
Sent: Tuesday, May 10, 2005 3:12 PM
To: pgsql-general@xxxxxxxxxxxxxx
Subject: 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@xxxxxxxxxxxxxxxxxx

 

 

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

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


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux