mysql创建索引的时候支持字段的desc排序方式吗

MySql创建索引时支持ASC或DESC排序。下面举例 创建表时同时创建索引降序排序(sname 字段上普通索引降序)create table tbl1 (id int unique, sname varchar(50),index tbl1_index_sname(sname desc));在已有的表创建索引语法 create [unique|fulltext|spatial] index 索引名 on 表名(字段名 [长度]...
mysql创建索引的时候支持字段的desc排序方式吗
MySql创建索引时支持ASC或DESC排序。

下面举例
创建表时同时创建索引降序排序(sname 字段上普通索引降序)
create table tbl1 (
id int unique, sname varchar(50),
index tbl1_index_sname(sname desc)
);

在已有的表创建索引语法
create [unique|fulltext|spatial] index 索引名
on 表名(字段名 [长度] [asc|desc]);2016-08-10
mengvlog 阅读 37 次 更新于 2025-10-31 02:00:05 我来答关注问题0
檬味博客在线解答立即免费咨询

mySQL相关话题

Copyright © 2023 WWW.MENGVLOG.COM - 檬味博客
返回顶部