SQL-W3School-楂樼骇锛歋QL CREATE INDEX 璇彞

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了SQL-W3School-楂樼骇锛歋QL CREATE INDEX 璇彞相关的知识,希望对你有一定的参考价值。

鏍囩锛?a href='http://www.mamicode.com/so/1/%e6%9f%a5%e8%af%a2' title='鏌ヨ'>鏌ヨ   idt   16px   璇诲彇   fir   class   https   info   color   

ylbtech-SQL-W3School-楂樼骇锛歋QL CREATE INDEX 璇彞

 

1.杩斿洖椤堕儴
1銆?/div>

CREATE INDEX 璇彞鐢ㄤ簬鍦ㄨ〃涓垱寤虹储寮曘€?/strong>

鍦ㄤ笉璇诲彇鏁翠釜琛ㄧ殑鎯呭喌涓嬶紝绱㈠紩浣挎暟鎹簱搴旂敤绋嬪簭鍙互鏇村揩鍦版煡鎵炬暟鎹?/span>銆?/strong>

绱㈠紩

鎮ㄥ彲浠ュ湪琛ㄤ腑鍒涘缓绱㈠紩锛屼互渚挎洿鍔犲揩閫熼珮鏁堝湴鏌ヨ鏁版嵁銆?/p>

鐢ㄦ埛鏃犳硶鐪嬪埌绱㈠紩锛屽畠浠彧鑳借鐢ㄦ潵鍔犻€熸悳绱?鏌ヨ銆?/p>

娉ㄩ噴锛氭洿鏂颁竴涓寘鍚储寮曠殑琛?/span>闇€瑕佹瘮鏇存柊涓€涓病鏈夌储寮曠殑琛?span style="background-color: #ffff00;">鏇村鐨勬椂闂?/span>锛岃繖鏄?span style="background-color: #ffff00;">鐢变簬绱㈠紩鏈韩涔熼渶瑕佹洿鏂?/span>銆傚洜姝わ紝鐞嗘兂鐨勫仛娉曟槸浠呬粎鍦?span style="background-color: #ffff00;">甯稿父琚悳绱㈢殑鍒楋紙浠ュ強琛級涓婇潰鍒涘缓绱㈠紩銆?/p>

SQL CREATE INDEX 璇硶

鍦ㄨ〃涓婂垱寤轰竴涓畝鍗曠殑绱㈠紩銆傚厑璁镐娇鐢ㄩ噸澶嶇殑鍊硷細

CREATE INDEX index_name
ON table_name (column_name)

娉ㄩ噴锛?column_name" 瑙勫畾闇€瑕佺储寮曠殑鍒椼€?/p>

SQL CREATE UNIQUE INDEX 璇硶

鍦ㄨ〃涓婂垱寤轰竴涓敮涓€鐨勭储寮曘€傚敮涓€鐨勭储寮曟剰鍛崇潃涓や釜琛屼笉鑳芥嫢鏈夌浉鍚岀殑绱㈠紩鍊笺€?/p>

CREATE UNIQUE INDEX index_name
ON table_name (column_name)

CREATE INDEX 瀹炰緥

鏈緥浼氬垱寤轰竴涓畝鍗曠殑绱㈠紩锛屽悕涓?"PersonIndex"锛屽湪 Person 琛ㄧ殑 LastName 鍒楋細

CREATE INDEX PersonIndex
ON Person (LastName) 

濡傛灉鎮ㄥ笇鏈涗互闄嶅簭绱㈠紩鏌愪釜鍒椾腑鐨勫€硷紝鎮ㄥ彲浠ュ湪鍒楀悕绉?span style="background-color: #ffff00;">涔嬪悗娣诲姞淇濈暀瀛?nbsp;DESC锛?/p>

CREATE INDEX PersonIndex
ON Person (LastName DESC) 

鍋囧鎮ㄥ笇鏈涚储寮曚笉姝竴涓垪锛屾偍鍙互鍦ㄦ嫭鍙蜂腑鍒楀嚭杩欎簺鍒楃殑鍚嶇О锛岀敤閫楀彿闅斿紑锛?/p>

CREATE INDEX PersonIndex
ON Person (LastName, FirstName)
2銆?/div>
2.杩斿洖椤堕儴
 
3.杩斿洖椤堕儴
 
4.杩斿洖椤堕儴
 
5.杩斿洖椤堕儴
1銆?/div>
2銆?/div>
 
6.杩斿洖椤堕儴
 
鎶€鏈浘鐗? src= 浣滆€咃細ylbtech
鍑哄锛?a href="http://ylbtech.cnblogs.com/" target="_blank">http://ylbtech.cnblogs.com/
鏈枃鐗堟潈褰掍綔鑰呭拰鍗氬鍥叡鏈夛紝娆㈣繋杞浇锛屼絾鏈粡浣滆€呭悓鎰忓繀椤讳繚鐣欐娈靛0鏄庯紝涓斿湪鏂囩珷椤甸潰鏄庢樉浣嶇疆缁欏嚭鍘熸枃杩炴帴锛屽惁鍒欎繚鐣欒拷绌舵硶寰嬭矗浠荤殑鏉冨埄銆?/span>

以上是关于SQL-W3School-楂樼骇锛歋QL CREATE INDEX 璇彞的主要内容,如果未能解决你的问题,请参考以下文章

楂樼骇鎸囦护

SqlServer楂樼骇鐗规€?-瀛樺偍杩囩▼

Kubernetes 瀛︿範21 kubernetes楂樼骇璋冨害鏂瑰紡

鎸佺画闆嗘垚楂樼骇绡囦箣Jenkins cli涓嶫enkins ssh

360楂樼骇鍓嶇鏋舵瀯甯圚ax(璐哄笀淇?锛氬墠绔紑鍙戠紪绋嬭瑷€鐨勮繃鍘汇€佺幇鍦ㄥ拰鏈潵

SQL-W3School:SQL DELETE 语句

(c)2006-2024 SYSTEM All Rights Reserved IT常识