SQLite Forum

ROWID in compound SELECT
Row-id aliases have always worked and still works, and is the only good way to do anything "by rowid".

It's not good SQL to refer stuff in SORT BY clauses, or any other, that are not explicitly defined in your schema, and that SQLite even allows this is a specific peculiarity. It did however cause problems, especially in subqueries and views, which I believe is why the change was made.

You /can/ compile a version that allows it still, but honestly my advice is to change your queries or schemata and use explicit aliases (you did demonstrated a clear understanding of that mechanism).