Search Postgresql Archives

Sorting problems with SELECT * FROM table WHERE name LIKE 'Ö%'

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi there,

I have a problem when sorting records with:
SELECT * FROM table WHERE name LIKE 'Ö%'

I am running Postgres 8.02 with a database whose character encoding is UNICODE.

The SQL Query

  SELECT *
    FROM member
    WHERE name LIKE 'O%'
          OR
          name like 'Ö%'
    ORDER BY name


returns this:
 Öhlmann
 Öhmann
 Obenaus
 Ochoa
 O'Donovan
 Oehme
 Oklant
 Oltub
 Oltüch
 Oltutz
 Oltüwer

According to german sorting rules the result is fine except the both first entries "Öhlmann" and "Öhmann".
Why do appear these records at the beginning of the list?
The proper result should read like this:
 Obenaus
 Ochoa
 O'Donovan
 Oehme
 Öhlmann
 Öhmann
 Oklant
 Oltub
 Oltüch
 Oltutz
 Oltüwer



The same problem accours when using "E" where my result is this:
  Élie de Beaumont
  Eberer
  Ecü
  Edding
  Emmer

The proper result should be:
  Eberer
  Ecü
  Edding
  Élie de Beaumont
  Emmer


Any idea how I can solve this problem?


Thank you very much in advance,
Nico

---------------------------(end of broadcast)---------------------------
TIP 2: Don't 'kill -9' the postmaster

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux