Welcome to the dBforums forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions, articles and access our other FREE features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload your own photos and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact support.

If you prefer not to see double-underlined words and corresponding ads, place your cursor
here for ContentLink opt out.

Go Back  dBforums > Database Server Software > PostgreSQL > Alphabetical Sorting Error

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 07-09-03, 19:52
Darmok Darmok is offline
Registered User
 
Join Date: Jul 2003
Posts: 2
Alphabetical Sorting Error

Hello,

I've been trying to sort a field alphabetically in Postgres 7.3.3 on a
Mandrake 8.1 box.

As you can see below, Music comes after Musical, and that is not alphabetical order. Does anyone know how to get it in alphabetical order? The database is using SQL_ASCII encoding.

Thanks in advance for any help!

AugPERdb=# \d test
Attribute | Type | Modifier
-----------+------------------------+----------
title | character varying(255) |

AugPERdb=# select * from test order by lower(title);
title
-------------------------
Musical Quarterly
Musical Times
Music and Letters
Music & Anthropology
Music Educators Journal
Music Perception
Music Week
(7 rows)
Reply With Quote
  #2 (permalink)  
Old 07-14-03, 09:49
karim2k karim2k is offline
Registered User
 
Join Date: Apr 2003
Location: Tunisia
Posts: 192
Thumbs up varchar

Try with varchar, In my databse working with varcahr never show errors , the order is alright even with arabic encoding !
__________________
Open up
Take a look to my Blog http://www.rundom.com/karim2k
Reply With Quote
  #3 (permalink)  
Old 07-14-03, 15:43
Darmok Darmok is offline
Registered User
 
Join Date: Jul 2003
Posts: 2
Thanks, this is the query I used.

SELECT * from test order by lower(title::character);

Works great!
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On