Skip site navigation (1) Skip section navigation (2)

Re: ORDER BY Problem...

From: "Reinoud van Leeuwen" <reinoud(at)xs4all(dot)nl>
To: <S(dot)Olloz(at)soid(dot)ch>
Cc: <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: ORDER BY Problem...
Date: 2001-06-06 12:29:25
Message-ID: 1194.194.109.0.126.991830565.squirrel@webmail2.xs4all.nl (view raw or flat)
Thread:
Lists: pgsql-hackers
> Hello...
> 
> Why does Postgresql order the uppercase letters first?
> 
> I have e.g. a table with one row an in this row there are follow
> values:
> 
> row1
> ----
> ADC
> aa
> ABC
> 
> With this select-syntax 
> 
> select * from table order by row1
> 
> I become this output
> 
> ABC
> ADC
> aa
> 
> but I want this ouptut:
> 
> aa
> ABC
> ADC
> 
> What do I wrong?

This will not solve your problem, but a way around this is to sort on upper
(row1):

# select * from test order by col1;
 col1
------
 ABCD
 AD
 Abc
(3 rows)

# select * from test order by upper(col1);
 col1
------
 Abc
 ABCD
 AD
(3 rows)



In response to

pgsql-hackers by date

Next:From: Magnus Naeslund(f)Date: 2001-06-06 13:59:13
Subject: vacuumdb -a -z hangs
Previous:From: Reinoud van LeeuwenDate: 2001-06-06 12:24:41
Subject: Re: capturing stored procedure return values from php??please help .

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group