´ÓÒ»µÀÌ⿪ʼ·ÖÎö£º
¼ÙÉèij¸ö±íÓÐÒ»¸öÁªºÏË÷Òý£¨c1,c2,c3,c4£©Ò»Ï¡ª¡ªÖ»ÄÜʹÓøÃÁªºÏË÷ÒýµÄc1,c2,c3²¿·Ö
A where c1=x and c2=x and c4>x and c3=x
B where c1=x and c2=x and c4=x order by c3
C where c1=x and c4= x group by c3,c2
D where c1=? and c5=? order by c2,c3
E where c1=? and c2=? and c5=? order by c2,c3
ÓÐËÖªµÀÏÂÃæA-EÄÜ·ñ¿ÉÒÔʹÓÃË÷Òý£¡£¡ÎªÊ²Ã´£¿
OK£»¿ªÊ¼
´´½¨±í£º
insert into t values ('a1','a2','a3','a4','a5'), ('b1','b2','b3','b4','b5');
²åÈëÊý¾Ý£º
insert into t values ('a1','a2','a3','a4','a5'), ('b1','b2','b3','b4','b5');
alter table t add index c1234(c1,c2,c3,c4);
ÉÔ×÷¸Ä±ä£º
ʹÓÃgroup by Ò»°ãÏÈÉú³ÉÁÙʱÎļþ£¬ÔÚ½øÐÐÅÅÐò
order by ÄÄ£¿Í¬ÉÏÃæÀà似À²
ÉÔ΢¸Ä±äһϣ¬·ÖÎö£ºÖªµÀÔÀí¶¼ºÜÈÝÒ×À²£¡
ÉÏÃæÎÊÌâ´ð°¸ÊǶàÉÙ£¿·´ÕýÎÒÊDz»ÖªµÀ£¡<†·Ÿ"http://www.Bkjia.com/kf/ware/vc/" target="_blank" class="keylink">vcD4KPHA+19y94bnmwsm/ybXDo7o8L3A+CjxwPjxpbWcgc3JjPQ=="http://www.2cto.com/uploadfile/Collfiles/20141117/2014111709271236.png" alt="">