永发信息网

sql select 怎样指定索引

答案:2  悬赏:10  手机版
解决时间 2021-02-15 16:39
  • 提问者网友:却不属于对方
  • 2021-02-15 02:22
sql select 怎样指定索引
最佳答案
  • 五星知识达人网友:狂恋
  • 2021-02-15 03:44
select * from nTableName where xxx =

order by zzz
//xxx、zzz就是你在数据库定义的索引字段
全部回答
  • 1楼网友:天凉才是好个秋
  • 2021-02-15 05:14
--测试数据 create table tb(a int,b int,c int) create clustered index idx_tb_a on tb(a) create index idx_tb_b on tb(b) create index idx_tb_c on tb(c) insert tb select 1,3,2 insert tb select 2,2,1 insert tb select 3,1,3 --指定使用字段a上的索引 select * from tb with(index=idx_tb_a) --指定使用字段b上的索引 select * from tb with(index=idx_tb_b) --指定使用字段c上的索引 select * from tb with(index=idx_tb_c) drop table tb写了这么多,希望对你有帮助
我要举报
如以上回答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
点此我要举报以上问答信息
大家都在看
推荐资讯