SQLSERCER 建立 改變 刪除索引

2021-09-08 15:21:23 字數 1041 閱讀 8068

create

index

newindex 

onnewtable (field1); 

create

index

newindex 

onnewtable (field1) 

with

ignore 

null;

生成欄位field1的索引欄位newindex,兩條語句作用相同

生成後field1欄位可以有相同的值,可以有空值(null)

create

index

newindex 

onnewtable(field1) 

with

primary; 

生成欄位field1的索引欄位newindex,注意,每個表裡只能有乙個主索引(primary)。生成後field1欄位不能有相同的值,不能有空值(當然,如果是text型別,可以有乙個空串,但是空串不是空值)

create

unique

index

newindex 

onnewtable(field1);

欄位field1不能有相同的值,但可以有空值(兩個空值不算相同的值)

create

index

newindex 

onnewtable(field2) 

with

disallow 

null

欄位field1可以有相同的值,但不能有空值

create

index

newindex 

onnewtable(field1 

asc, field2 

desc);

可以在索引語句中加入asc(公升序)或desc(降序)來控制記錄排列順序如果不使用順序字,sql則預設使用asc順序

drop

index

newindex 

onnewtable; 

刪除表newtable中的索引newindex,語句執行前索引newindex必須存在

改變滑動刪除按鈕樣式

在自定義 cell 中實現如下 改變滑動刪除按鈕樣式 void layoutsubviews super layoutsubviews for uiview subview in self.subviews if subview iskindofclass nsclassfromstring uit...

建立刪除表

建立表 user studb gocreate table stuinfo 建立學員資訊表 stuname varchar 20 not null,學員姓名,資料型別varchar 20 非空 stuno char 6 not null,學號,資料型別char 6 非空 stuage int not...

建立刪除DBLINK

三.建立dblink的方法 1.create public database link dblink connect to totalplant identified by totalplant using description address list address protocol tcp ...