SQLite Forum

Possible Bug - View behaves differently to Table in SELECT
Login
Hi,

I'm puzzled by this behaviour. 

Select from three views:

    select * FROM   [_RPMItems_] [e]
        LEFT JOIN [_networkNodes_] [n] ON [n].[id] = [e].[id]
        LEFT JOIN [_elementHumanReadableNames_] eHRN on eHRN.id = e.id

Results in

    [1] [SQLITE_ERROR] SQL error or missing database (ON clause references tables to its right)

Whereas replacing one of the views with a materialised version of self

    select * FROM   [_RPMItems_] [e]
        LEFT JOIN [_networkNodes_] [n] ON [n].[id] = [e].[id]
        LEFT JOIN [MaTelementHumanReadableNamesMaT] eHRN on eHRN.id = e.id

does not generate an error.

Under what conditions should a view behave differently to a materialised version of itself in SELECT?

Sample .db is [here](https://www.dropbox.com/s/iai3tlugo9a3kgs/rosellamodel%20Sample%20Bug%20Report%20SQLITE.db?dl=0)

All the best,

David