Re: [GENERAL] Result of ORDER-BY

2011-11-18 Thread Good Day Books
> 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 (pgsql-gene

Re: [GENERAL] Result of ORDER-BY

2011-11-18 Thread Good Day Books
> 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, alth

Re: [GENERAL] Result of ORDER-BY

2011-11-17 Thread Andrew Sullivan
On Fri, Nov 18, 2011 at 12:14:35PM +0900, Good Day Books wrote: > [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 > > Does anyone have an explanation why this is not so; are the spec

Re: [GENERAL] Result of ORDER-BY

2011-11-17 Thread Christophe Pettus
On Nov 17, 2011, at 7:14 PM, Good Day Books wrote: > 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? The query as shown does't actually

[GENERAL] Result of ORDER-BY

2011-11-17 Thread Good Day Books
[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) # Fictio