by cryptonector · 5y ago · 0 comments
That's fair and allowed by the standard, but it will break some things.
If it's what I'm thinking of, this concern was carefully considered:
If a subquery in the FROM clause has an ORDER BY, that ORDER BY is omitted if all of the following conditions are also true:
1. There is no LIMIT clause in the subquery
2. The subquery was not one of the virtual subqueries added internally by SQLite for window-function processing
3. The subquery is not part of the FROM clause in an UPDATE-FROM statement
4. The outer query does not use any aggregate functions other than the built-in count(), min(), and/or max() functions.
5. Either the outer query has its own ORDER BY clause or else the subquery is one term of a join.
from https://sqlite.org/forum/forumpost/878ca7a9be0862af?t=hAn almost Clintonian phrase! :-)