SQLite Forum

Select by column id
Login
Note that the order of columns may be changed in either the declaration of a table or the field list in the select statement. It is considered quite risky to rely on any implicit order of fields in a query.

With the C interface, the sqlite3_column() family of functions refer to the nth column of the result by providing the desired index in the iCol parameter.

There is no syntax for SELECT <column #7> FROM table other than providing the name of the seventh column in the statement itself. Neither is it possible to SELECT :col FROM table or to SELECT <column> FROM :table because the names of the coulmns and tables must be known beforehand to allow a query to be prepared.