Results 1 to 3 of 3
  1. #1
    Join Date
    Jul 2003
    Posts
    2

    Unanswered: 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)

  2. #2
    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

  3. #3
    Join Date
    Jul 2003
    Posts
    2
    Thanks, this is the query I used.

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

    Works great!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •