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 [hotelsowntowncityId] ON [hotelsowntown] ([cityId]);

猜你喜欢

转载自asdf314159265.iteye.com/blog/1725496