SQLite Forum

ROWID in compound SELECT
Login
In my application I have used for a long time the ROWID alias to sort, also in compound SELECT statements, such as:

SELECT * FROM (SELECT * FROM <MainTable> ORDER BY ROWID) AS main <JoinStatement> ORDER BY main.ROWID

My tables never have an own declared ROWID column, but always an INTEGER PRIMARY KEY column like "Nr" that will function as ROWID; according to the documentation ROWID will act as an alias to this "Nr".

After updating to SQLite3 version 3.36.0 (I have skipped several versions) the system does not recognize anymore the alias "main.ROWID".

To solve this I have to add explicitly ROWID in the primary SELECT statement:

SELECT * FROM (SELECT ROWID,* FROM <MainTable> ORDER BY ROWID) AS main <JoinStatement> ORDER BY main.ROWID

My question is, was this change in alias behaviour of ROWID made deliberately? And why?

Thanks.