jef wrote:
> CREATE VIEW v1  AS SELECT x FROM t1 ORDER BY y DESC;
> CREATE VIEW vv1 AS SELECT x FROM v1 LIMIT 3;
>
> SELECT x FROM vv1 ORDER BY x;
>
> With vv1, the query planner/optimizer seems to push the LIMIT clause
> all the way to the "end" of the query. Is this the desired behavior?

A query is not guaranteed to have any specific sorting unless it is
using ORDER BY.  So for LIMIT to make sense, it must be in the same
query as the ORDER BY.


Regards,
Clemens
_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to