If you’re getting an error that reads ‘Parse error: near “ORDER”‘ in SQLite, it could be that you’re trying to use the ORDER BY
clause when using the VALUES
clause as a stand alone statement.
Although we can certainly use the VALUES
clause as a stand alone SQL statement, we can’t apply the ORDER BY
clause against it.
However all is not lost. Below is an example of how we can sort the results of the VALUES
statement.