mysql索引 include,在mysql中创建索引不起作用

Im using MYSQL Server 5.0 and im trying to use the next sentence of SQL Server and is not working at all. Please is there any way to apply this to Mysql also. Thank you very much.

CREATE NONCLUSTERED INDEX [IX_Dave_General] ON [dbo].[Stock]

(

[ArticleID] ASC,

[TranDate] DESC,

[TranCode] ASC

)

INCLUDE ( [Items],

[Price]) WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]

解决方案

The original SQL Server index used two features: covering indexes (with non-key columns under INCLUDE) and mixed sort direction (ASC and DESC columns).

Neither of those are supported by MySQL.

If you still need the index (say for exact matches over all three columns), use @Ray's answer.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值