索引可以是單列索引,也可以是多列索引。
(1)單列索引就是常用的一個列字段的索引,常見的索引。
(2)多列索引就是含有多個列字段的索引
alter table student add index sy(name,age,score);
索引sy就為多列索引,多列索引在以下幾中情況下才能有效:
select * from student where name='jia' and age>='12' //where條件中含有索引的首列字段和
那請問 假如 我做了 name 和 age的單獨索引了 假如 執(zhí)行select * from student where name='jia' and age>='12' 這個語句 會使用兩次索引嗎 name age的 那我還需要單獨建第三個 多列索引 嗎
認證高級PHP講師
Just make two single column indexes. If you don't know how to use the index, just explain it.