Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> Re: order by question

Re: order by question

From: John Clarke <jclarke_at_centroidsys.com>
Date: Wed, 30 Mar 2005 09:24:18 -0500
Message-ID: <20050330092418.7f869b74@centroidsys.com>


I get=20

CAT
Pen
cat
pen

on 9.2.0.6 when I simply order by name, but I *think* that this will do = what you want:

select * from=20
(select * from test
order by name)
order by upper(name)
/

> Hi,
> I have the following data in a table:

>=20

> SQL> select * from test order by name;
> NAME
> ----
> pen
> Pen
> cat
> CAT
>=20
>=20

> I want to order the records in alphabetically order first, followed by=
 upper
> case and then lower case.
>=20

> The result should be :
> CAT
> cat
> Pen
> pen
>=20

> I tried order by upper(name) but that did not yield the right result.
>=20

> Can someone shed some light.=20
>=20

> Thanks.
>=20

> Geraldine
> --
> http://www.freelists.org/webpage/oracle-l
>=20
--
http://www.freelists.org/webpage/oracle-l
Received on Wed Mar 30 2005 - 09:28:10 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US