SQLite - No such column when column exists I have a table (trackedinfo) inside my database that has the following columns (columns obtained by running PRAGMA table_info(trackedinfo);)



The problem is that even though the column sendok exists, when running a query on the database with that field, it throws an error.

Example queries:

SELECT * FROM trackedinfo WHERE sendok IS NULL;
SELECT sendok FROM trackedinfo;


Error:

SQLITE_ERROR: SQL error or missing database (no such column: sendok)




But, if I run a query selecting all of the fields, it brings me the info regarding sendok:



Here is the CREATE command of the database:

CREATE TABLE trackedinfo
(
    id INTEGER PRIMARY KEY,
    date_time_start TEXT,
    date_time_end TEXT,
    tracked_name TEXT,
    tracked_origin TEXT,
    tracked_maker TEXT,
    tracked_version TEXT,
    tracked_type TEXT,
    sendok TEXT,
    tracked_id TEXT
);


EDIT

It also happens with the column tracked_id

EDIT 2

Info that I got by executing .schema trackedinfo

CREATE TABLE IF NOT EXISTS "trackedinfo" ("id" INTEGER PRIMARY KEY, "date_time_start" TEXT, "date_time_end" TEXT, "tracked_name" TEXT, "tracked_origin" TEXT, "tracked_maker" TEXT, "tracked_version" TEXT, "tracked_type" TEXT, "sendok " TEXT, "tracked_id " TEXT);
The problem was that I had an space at the end of the name of the columns, solved the problem by deleting such spaces.
Before:
CREATE TABLE IF NOT EXISTS &quot;trackedinfo&quot; (&quot;id&quot; INTEGER PRIMARY KEY, &quot;date_time_start&quot; TEXT, &quot;date_time_end&quot; TEXT, &quot;tracked_name&quot; TEXT, &quot;tracked_origin&quot; TEXT, &quot;tracked_maker&quot; TEXT, &quot;tracked_version&quot; TEXT, &quot;tracked_type&quot; TEXT, &quot;sendok &quot; TEXT, &quot;tracked_id &quot; TEXT);

After:
CREATE TABLE IF NOT EXISTS &quot;trackedinfo&quot; (&quot;id&quot; INTEGER PRIMARY KEY, &quot;date_time_start&quot; TEXT, &quot;date_time_end&quot; TEXT, &quot;tracked_name&quot; TEXT, &quot;tracked_origin&quot; TEXT, &quot;tracked_maker&quot; TEXT, &quot;tracked_version&quot; TEXT, &quot;tracked_type&quot; TEXT, &quot;sendok&quot; TEXT, &quot;tracked_id&quot; TEXT);

In the above examples white spaces whithin &quot;sendok&quot; and &quot;tracked_id&quot; columns has been removed.