Skip to content Skip to sidebar Skip to footer

Create A Indexed Column In Sqlite

Can I create index on a column in the create table command in sqlite? I tried this command below in sqlite3 in Android shell. It seems to work. sqlite> create table mytest (id i

Solution 1:

A separate query is needed:

CREATE INDEX mytest_id_idx ON mytest(id);

Though it sounds like you want to make the id column the auto increment primary key?

CREATETABLE mytest(id INTEGERPRIMARY KEY);

Post a Comment for "Create A Indexed Column In Sqlite"