On 10/28/2011 12:42 PM, Tobias Sjösten wrote:
But when I group it by 'g' it completely disregards the ordering:

SELECT g,v FROM t GROUP BY g ORDER BY v ASC;
a|3
b|3

What seems to be the problem? The resultset is ordered by the second column, isn't it? What did you expect to happen differently?

Using descending order does not matter, btw. The result is the same.

You have two identical values - why would you expect the order to matter?

I'm not sure if this is the expected behavior in SQLite but for me it
certainly wasn't. I was thinking SQLite would act as MySQL and respect
the ordering when grouping.

I'm pretty sure MySQL would produce an error on your query. I don't believe it allows a column that is neither in a GROUP BY clause nor in an argument of an aggregate function.
--
Igor Tandetnik

_______________________________________________
sqlite-users mailing list
[email protected]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to