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
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)
以上是关于SQL-W3School-楂樼骇锛歋QL CREATE INDEX 璇彞的主要内容,如果未能解决你的问题,请参考以下文章 Kubernetes 瀛︿範21 kubernetes楂樼骇璋冨害鏂瑰紡 鎸佺画闆嗘垚楂樼骇绡囦箣Jenkins cli涓嶫enkins ssh |