> In the first query, there is an aggregate in the result set, so an > implicit GROUP BY is used. The ORDER BY is meaningless, but not an > error (and could be more easily written "ORDER BY 1"; see below).
The order is not meaningless. It can return an error or do nothing. If aggregate in order by isn't allowed it should return an error. From the first query we can see that it is allowed. It would be nice if database behaved consistently. We already know that MS SQL and Firebird do. Same with MySQL. I'm not sure, but I think I'v tried also postgres with same result. I'm sure that in sqlite it was missed and it is not an intentional behaviour. And yes - obviously the query with a bug makes no sense and there is no reason to ever use it. Just like adding order by to any other query that return 1 row before ordering. _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users