Result of ORDER-BY

From: "Good Day Books" <goodday(at)gol(dot)com>
To: <pgsql-general(at)postgresql(dot)org>
Subject: Result of ORDER-BY
Date: 2011-11-18 03:14:35
Message-ID: 73605E5F6E3A432DBCC9A40A58BA781B@GDBMain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

[PostgreSQL 8.3.9]

I have a query, as follows

SELECT DISTINCT ON(category) category
FROM gdb_books
WHERE category LIKE 'Fiction%'
GROUP BY category

The (partial) result is this:
...
# Fiction - General (A)
# Fiction - General - Anthologies
# Fiction - General (B)
# Fiction - General (C)
# Fiction - General (D)
...

I would have expected '- Anthologies' to be either at the top, or at the bottom of the result.

Does anyone have an explanation why this is not so; are the special characters (parenthesis, hyphen) just ignored? If so, is there a way to force ORDER BY to include the special characters in the sort?

Thank you for any reply.
Pat Willener
GDB Tokyo

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Bill Thoen 2011-11-18 03:17:26 Using the internal data dictionary
Previous Message Tomas Vondra 2011-11-18 02:41:36 Re: Huge number of INSERTs