create a indexed column in sqlite

后端 未结 1 1645
一向
一向 2020-12-28 15:45

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.

sqlit         


        
相关标签:
1条回答
  • 2020-12-28 16:23

    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?

    CREATE TABLE mytest(id INTEGER PRIMARY KEY);
    
    0 讨论(0)
提交回复
热议问题