ºÜÇ¿´óµÄÒ»±¾Êé!£¬¸÷ÖÖÖ÷Á÷DBMSϵĽâ¾ö·½°¸¶¼ÓУ¬±¾ÊéÊÇÒ»±¾Ö¸ÄÏ£¬ÆäÖаüº¬ÁËһϵÁÐSQL µÄ³£ÓÃÎÊÌâÒÔ¼°ËüÃǵĽâ¾ö·½°¸£¬Ï£ÍûÄܶԶÁÕßµÄÈÕ³£¹¤×÷ÓÐËù°ïÖú¡£±¾Ê齫Ïà¹ØÖ÷ÌâµÄС½Ú¹é³ÉÕ£¬Èç¹û¶ÁÕßÓöµ½²»Äܽâ¾öµÄSQL ÐÂÎÊÌ⣬¿ÉÒÔÏÈÕÒµ½×î¿ÉÄÜÊÊÓõÄÕ£¬ä¯ÀÀÆäÖи÷С½ÚµÄ±êÌ⣬ϣÍû¶ÁÕßÄÜ´ÓÖÐÕÒµ½½â¾ö·½°¸£¬ÖÁÉÙ¿ÉÒÔÕÒµ½µãÁé¸Ð¡£
ÔÚÕâ±¾ÊéÖÐÓÐ150 ¶à¸öС½Ú£¬Õ⻹½ö½öÊÇSQL ËùÄÜ×öµÄÊÂÇéµÄÒ»ÁÛ°ëצ¡£½â¾öÈÕ³£±à³ÌÎÊÌâµÄ½â¾ö·½°¸µÄÊýÁ¿½öÈ¡¾öÓÚÐèÒª½â¾öµÄÎÊÌâµÄÊýÁ¿£¬±¾ÊéûÓи²¸ÇËùÓÐÎÊÌ⣬ÊÂʵÉÏÒ²²»¿ÉÄܸ²¸Ç£»È»¶ø´ÓÖпÉÒÔÕÒµ½Ðí¶à¹²Í¬µÄÎÊÌâ¼°Æä½â¾ö·½°¸£¬ÕâЩ½â¾ö·½°¸ÖÐÓõ½Ðí¶à¼¼ÇÉ£¬¶ÁÕßѧµ½ÕâЩ¼¼ÇɾͿÉÒÔ½«ËüÃÇÀ©Õ¹²¢Ó¦Óõ½±¾Êé²»¿ÉÄܸ²¸ÇµÄÆäËûÐÂÎÊÌâÉÏ¡£
SQL¿ª·¢ÈËÔ±Anthony MolinaroÇã³Ï·îÏ×Ëû¶àÄê»ýÀ۵ķḻ¾Ñ飬ʹÎÒÃÇÄܹ»³ä·ÖÀûÓÃSQLµÄÇ¿´ó¹¦ÄÜ¡£Äú½«ÔÚ±¾ÊéÖÐѧµ½£º
¡¤Êµ¼ÊÉÏ£¬ÔÚ¹ýÈ¥µÄ10ÄêÖУ¬¶ÔÓÚSQL¶øÑÔ£¬´°¿Úº¯ÊýµÄʹÓÃÊÇ×îÖØÒªµÄÔöÇ¿¹¦ÄÜ¡£SQLµÄʹÓÃÕߣ¬¾ø²»¸Ã´í¹ýÕâЩº¯Êý¡£
¡¤ÀûÓÃÇ¿´óµÄÊý¾Ý¿âÌض¨¹¦ÄÜ£¬ÀýÈçSQL ServerµÄPIVOTºÍUNPIVOTÔËËã·û£¬OracleµÄMODEL×Ӿ䣬ÒÔ¼°PostgreSQLµÄGENERATE_SERIESº¯Êý¡£..
¡¤ÀûÓûù¸É±í£¬´ÓÐе½ÁУ¬»òÕß´ÓÁе½ÐУ¬ÒÔ²»Í¬·½Ê½²é¿´Êý¾Ý£¬»ù¸É±í±ãÓÚÐмä¼ÆË㣬¶øÇÒ¿ÉÒÔ¶Ô½á¹û¼¯½øÐÐË«±¶¡°Í¸ÊÓ¡±¡£
¡¤´´½¨Ö±·½Í¼£¬ÒÔÖ±¹Û·½Ê½Õ¹ÏÖÊý¾Ý£¬¶Ô¿É±ä·¶Î§µÄÊý¾ÝÖ´ÐоۺÏÔËË㣬Éú³É×ܼƺÍС¼Æ½á¹û£¬»¹ÓÐÆäËû¸ß¼¶µÄÊý¾Ý²Ö¿â¼¼Êõ¡£
¡¤×Ö·û´®´¦Àí£¬Äú¿ÉÒÔʹÓÃSQLÀ´·ÖÎö×Ö·û¡¢µ¥´Ê»òÕßÊÇ×Ö·û´®µÄÓнçÔªËØ¡£
ÕÂĿ¼£º
µÚ1Õ ¼ìË÷¼Ç¼
µÚ2Õ ²éѯ½á¹ûÅÅÐò
µÚ3Õ ²Ù×÷¶à¸ö±í
µÚ4Õ ²åÈë¡¢¸üÐÂÓëɾ³ý
µÚ5Õ ԪÊý¾Ý²éѯ
µÚ6Õ ʹÓÃ×Ö·û´®
µÚ7Õ ʹÓÃÊý×Ö
µÚ8ÕÂ ÈÕÆÚÔËËã
µÚ9ÕÂ ÈÕÆÚ²Ù×÷
µÚ10Õ ·¶Î§´¦Àí
µÚ11Õ ¸ß¼¶²éÕÒ
µÚ12Õ ±¨±íºÍÊý¾Ý²Ö¿âÔËËã
µÚ13Õ ·Ö²ã²éѯ
µÚ14Õ Èô¸ÉÁíÀàÄ¿±ê
¸½Â¼A ´°¿Úº¯Êý²¹³ä
¸½Â¼B »Ø¹ËRozenshtein