寫的順序:select ... from... where.... group by... having... order by..
執行順序:from... where...group by... having.... select ... order by...
執行順序:from... where...group by... having.... select ... order by...
Mysql
全值匹配我最愛,最左前綴要遵守;
帶頭大哥不能死,中間兄弟不能斷;
索引列上少計算,范圍之后全失效;
LIKE百分寫最右,覆蓋索引不寫星;
不等空值還有or,索引失效要少用。