Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: sorting in oracle?
On Jul 11, 7:59 am, kilik3..._at_gmail.com wrote:
> If I create a table:
>
> CREATE TABLE FOO
> (
> BAR VARCHAR(5)
> );
>
> insert into foo values ('a');
> insert into foo values ('b');
> insert into foo values ('c');
> insert into foo values ('A');
> insert into foo values ('B');
> insert into foo values ('C');
>
> and run this select statement:
>
> select bar from foo order by bar;
>
> I get back:
>
> BAR
> -----
> A
> B
> C
> a
> b
> c
>
> Why don't I get back...
>
> BAR
> -----
> A
> a
> B
> b
> C
> c
>
> -Thx
Consult a table of ASCII characters and you'll realise the capital letters have lower ASCII values than the lower case letters. The sort is based upon the ASCII code. A quick search on Google would have provided numerous links to explain this.
David Fitzjarrell Received on Wed Jul 11 2007 - 08:17:35 CDT
![]() |
![]() |