浙江雁荡山 发表于 2016-11-28 11:37:10

sqlite索引/主键

唯一索引
sqlite> create table t1 (
   ...>         id      int primary key,
   ...>         col   varchar(20)
   ...> );
sqlite> create unique index uk_t1 on t1 (col);

主键索引
create table t2 (
   ...>         id1   int ,
   ...>         id2 int,
   ...>         col   varchar(20),
   ...>         constraint pk_t2 primary key (id1,id2)





CREATE INDEX ON ();
页: [1]
查看完整版本: sqlite索引/主键