See the other remark in this thread about GROUP BY and ORDER BY. Note
that GROUP BY used to cause ORDER BY every time, because it was always
implemented with a sort. That hasn't been true for several releases,
and if you're relying on that side effect it could be the cause of
this, although
The query as shown does't actually have an ORDER BY clause in it;
did you write GROUP BY where you meant ORDER BY?
Thank you for your reply. I tried all combinations
- GROUP BY
- ORDER BY
- GROUP BY ORDER BY
the result is always the same.
--
Sent via pgsql-general mailing list
[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)
#