如题所述
å¨æ们使ç¨MySQLæ°æ®åºæ¶ï¼æ¯è¾å¸¸ç¨ä¹æ¯æ¥è¯¢ï¼å
æ¬åºæ¬æ¥è¯¢ï¼å
³èæ¥è¯¢ï¼æ¡ä»¶æ¥è¯¢ççï¼å¯¹äºåä¸ä¸ªæä½ï¼SQLè¯å¥çå®ç°æå¾å¤ç§åæ³ï¼ä½æ¯ä¸åçåæ³æ¥è¯¢çæ§è½å¯è½ä¼æå¾å¤§çå·®å¼ãè¿é主è¦ä»ç»ä¸selectæ¥è¯¢ä¼åçè¦ç¹ã
1. 使ç¨æ ¢æ¥è¯¢æ¥å¿å»åç°æ ¢æ¥è¯¢ã
2. 使ç¨æ§è¡è®¡åå»å¤ææ¥è¯¢æ¯å¦æ£å¸¸è¿è¡ã
3. æ»æ¯å»æµè¯ä½ çæ¥è¯¢ççæ¯å¦ä»ä»¬è¿è¡å¨æä½³ç¶æä¸ âä¹ èä¹ ä¹æ§è½æ»ä¼ååã
4. é¿å å¨æ´ä¸ªè¡¨ä¸ä½¿ç¨count(*),å®å¯è½éä½æ´å¼ 表ã
5. 使æ¥è¯¢ä¿æä¸è´ä»¥ä¾¿åç»ç¸ä¼¼çæ¥è¯¢å¯ä»¥ä½¿ç¨æ¥è¯¢ç¼åã
6. å¨éå½çæ å½¢ä¸ä½¿ç¨GROUP BYèä¸æ¯DISTINCTã
7. å¨WHERE, GROUP BYåORDER BYåå¥ä¸ä½¿ç¨æç´¢å¼çåã
8. ä¿æç´¢å¼ç®å,ä¸å¨å¤ä¸ªç´¢å¼ä¸å å«åä¸ä¸ªåã
9. ææ¶åMySQLä¼ä½¿ç¨é误çç´¢å¼,对äºè¿ç§æ åµä½¿ç¨USE INDEXã
10. æ£æ¥ä½¿ç¨SQL_MODE=STRICTçé®é¢ã
11.对äºè®°å½æ°å°äº5çç´¢å¼å段ï¼å¨UNIONçæ¶å使ç¨LIMITä¸æ¯æ¯ç¨OR.
12. ä¸ºäº é¿å å¨æ´æ°åSELECTï¼ä½¿ç¨INSERT ON DUPLICATE KEYæè INSERT IGNORE ,ä¸è¦ç¨UPDATEå»å®ç°ã
3. ä¸è¦ä½¿ç¨ MAX,使ç¨ç´¢å¼å段åORDER BYåå¥ã
14. é¿å 使ç¨ORDER BY RAND().
15. LIMIT Mï¼Nå®é ä¸å¯ä»¥åç¼æ¥è¯¢å¨æäºæ åµä¸ï¼æèå¶å°ä½¿ç¨ã
16. å¨WHEREåå¥ä¸ä½¿ç¨UNION代æ¿åæ¥è¯¢ã
17. 对äºUPDATESï¼æ´æ°ï¼ï¼ä½¿ç¨ SHARE MODEï¼å ±äº«æ¨¡å¼ï¼ï¼ä»¥é²æ¢ç¬å éã
18. å¨éæ°å¯å¨çMySQLï¼è®°å¾æ¥æ¸©æä½ çæ°æ®åºï¼ä»¥ç¡®ä¿æ¨çæ°æ®å¨å ååæ¥è¯¢é度快ã
19. 使ç¨DROP TABLEï¼CREATE TABLE DELETE FROMä»è¡¨ä¸å é¤æææ°æ®ã
20. æå°åçæ°æ®å¨æ¥è¯¢ä½ éè¦çæ°æ®ï¼ä½¿ç¨*æ¶è大éçæ¶é´ã
21. èèæä¹ è¿æ¥ï¼èä¸æ¯å¤ä¸ªè¿æ¥ï¼ä»¥åå°å¼éã
22. åºåæ¥è¯¢ï¼å æ¬ä½¿ç¨æå¡å¨ä¸çè´è½½ï¼ææ¶ä¸ä¸ªç®åçæ¥è¯¢å¯ä»¥å½±åå ¶ä»æ¥è¯¢ã
23. å½è´è½½å¢å æ¨çæå¡å¨ä¸ï¼ä½¿ç¨SHOW PROCESSLISTæ¥çæ ¢çåæé®é¢çæ¥è¯¢ã
24. å¨å¼åç¯å¢ä¸äº§ççéåæ°æ®ä¸ æµè¯çææå¯ççæ¥è¯¢ã
æ¥æºï¼PHPç¨åºåé·éªæ¾çå客
1. 使ç¨æ ¢æ¥è¯¢æ¥å¿å»åç°æ ¢æ¥è¯¢ã
2. 使ç¨æ§è¡è®¡åå»å¤ææ¥è¯¢æ¯å¦æ£å¸¸è¿è¡ã
3. æ»æ¯å»æµè¯ä½ çæ¥è¯¢ççæ¯å¦ä»ä»¬è¿è¡å¨æä½³ç¶æä¸ âä¹ èä¹ ä¹æ§è½æ»ä¼ååã
4. é¿å å¨æ´ä¸ªè¡¨ä¸ä½¿ç¨count(*),å®å¯è½éä½æ´å¼ 表ã
5. 使æ¥è¯¢ä¿æä¸è´ä»¥ä¾¿åç»ç¸ä¼¼çæ¥è¯¢å¯ä»¥ä½¿ç¨æ¥è¯¢ç¼åã
6. å¨éå½çæ å½¢ä¸ä½¿ç¨GROUP BYèä¸æ¯DISTINCTã
7. å¨WHERE, GROUP BYåORDER BYåå¥ä¸ä½¿ç¨æç´¢å¼çåã
8. ä¿æç´¢å¼ç®å,ä¸å¨å¤ä¸ªç´¢å¼ä¸å å«åä¸ä¸ªåã
9. ææ¶åMySQLä¼ä½¿ç¨é误çç´¢å¼,对äºè¿ç§æ åµä½¿ç¨USE INDEXã
10. æ£æ¥ä½¿ç¨SQL_MODE=STRICTçé®é¢ã
11.对äºè®°å½æ°å°äº5çç´¢å¼å段ï¼å¨UNIONçæ¶å使ç¨LIMITä¸æ¯æ¯ç¨OR.
12. ä¸ºäº é¿å å¨æ´æ°åSELECTï¼ä½¿ç¨INSERT ON DUPLICATE KEYæè INSERT IGNORE ,ä¸è¦ç¨UPDATEå»å®ç°ã
3. ä¸è¦ä½¿ç¨ MAX,使ç¨ç´¢å¼å段åORDER BYåå¥ã
14. é¿å 使ç¨ORDER BY RAND().
15. LIMIT Mï¼Nå®é ä¸å¯ä»¥åç¼æ¥è¯¢å¨æäºæ åµä¸ï¼æèå¶å°ä½¿ç¨ã
16. å¨WHEREåå¥ä¸ä½¿ç¨UNION代æ¿åæ¥è¯¢ã
17. 对äºUPDATESï¼æ´æ°ï¼ï¼ä½¿ç¨ SHARE MODEï¼å ±äº«æ¨¡å¼ï¼ï¼ä»¥é²æ¢ç¬å éã
18. å¨éæ°å¯å¨çMySQLï¼è®°å¾æ¥æ¸©æä½ çæ°æ®åºï¼ä»¥ç¡®ä¿æ¨çæ°æ®å¨å ååæ¥è¯¢é度快ã
19. 使ç¨DROP TABLEï¼CREATE TABLE DELETE FROMä»è¡¨ä¸å é¤æææ°æ®ã
20. æå°åçæ°æ®å¨æ¥è¯¢ä½ éè¦çæ°æ®ï¼ä½¿ç¨*æ¶è大éçæ¶é´ã
21. èèæä¹ è¿æ¥ï¼èä¸æ¯å¤ä¸ªè¿æ¥ï¼ä»¥åå°å¼éã
22. åºåæ¥è¯¢ï¼å æ¬ä½¿ç¨æå¡å¨ä¸çè´è½½ï¼ææ¶ä¸ä¸ªç®åçæ¥è¯¢å¯ä»¥å½±åå ¶ä»æ¥è¯¢ã
23. å½è´è½½å¢å æ¨çæå¡å¨ä¸ï¼ä½¿ç¨SHOW PROCESSLISTæ¥çæ ¢çåæé®é¢çæ¥è¯¢ã
24. å¨å¼åç¯å¢ä¸äº§ççéåæ°æ®ä¸ æµè¯çææå¯ççæ¥è¯¢ã
æ¥æºï¼PHPç¨åºåé·éªæ¾çå客
温馨提示:答案为网友推荐,仅供参考