ɨÂë²ÎÓëÐÂÆ·0ÔªÊÔÓÃ
ɹµ¥¡¢¶¥Â¥ºÀÀñµÈÄãÄÃ
ExcelÖÐÈçºÎÓÃSQL½øÐж๤×÷²¾»ã×Ü£¿
[ͼƬ] ²é¿´È«²¿
»Ø´ðÊý
3
ä¯ÀÀÊý
1,873
ÐèÒªÓõ½VBAºÍÊý¾Ý¿âÓïÑÔÁË¡£Í¦¸´Ôӵģ¬²»¹ýÏÖÔÚÓÐÈí¼þÊÇ×ÔÉí¼¯³ÉÁËÊý¾Ý¿âµÄ£¬±¾Éí¾ÍÊÇ×öÆóÒµ°ì¹«µÄ£¬ÕâÑù¾ÍºÜ·½±ãÁË¡£
¾Í°²ÀûÒ»ÏÂÔƱí°É£¬Ô½ðɽϵWPS¿ª·¢ÍŶӵÄ×÷Æ·£¬×ÔÉí¼¯³ÉSQLÊý¾Ý¿â£¬¶à±í»ã×ܸüÊÇ¿ÉÒÔ×Ô¶¯Íê³É£¬¹¤×÷¼òÖ±²»ÒªÌ«ÇáËÉ¡£
Êý¾Ý¿âÍêÈ«²»ÓùÜÁË£¬×Ô¼º´´½¨Ò»¸ö±¾µØÓ¦ÓþͿÉÒÔÁË¡£À´ËµËµ»ã×ܱí¸ñ
¾Ù¸öÎÒÇ°¼¸ÌìѧϰµÄÀý×Ó°É£¬ÔÂÏúÊÛÓ뱨±íͳ¼Æ
ÏÈ¿´Ò»¸öÏúÊÛ±í£¬ËüÊÇÕâ¸öÑù×ÓµÄ
ÕâÒѾºÍEXCEL²»Í¬ÁË°¡£¬Ò»¸öÒ³ÃæÉÏ·ÅÁË3¸ö±í£¬²»¿É˼Òé
ÕâÊÇ°ÑÔ·ݺÍÏúÊÛ¶î¶ÔÍ⿪·Å£¬Èûã×ܱ¨±í¿ÉÒÔ×ÔÓÉ»ñÈ¡Êý¾Ý£¬´Ó¶øʵÏÖ×Ô¶¯Éú³É¡£
Éè¼Æ±¨±í½çÃ棬ÈκÎÊý¾Ý¶¼²»ÐèÒªÊÖ¶¯Ìîд£¬¶Ô¡°²éѯ¡±°´Å¥½øÐÐÉè¼Æ¼´¿É£»
ʵ¼ÊʹÓã¬ÒòΪÊÇÎÒÇ°¼¸Ììѧϰ×öµÄ£¬ËùÒÔÖ»ÓÐ6ÔµÄÊý¾Ý£¬Ã»Óйý¶à¼ÈëÊý¾Ý¡£µ±È»²»Ö¹ÏúÊÛ±¨±í£¬»îѧ»îÓ㬺ܶàÀàÐ͵ıí¸ñ¡¢ÁìÓò¶¼ÊÇ¿ÉÒÔʹÓõġ£
ÔƱíÊÇÃâ·ÑÈí¼þ£¨ÓÀ¾ÃÃâ·Ñ°æ±¾£©£¬½ÌѧÊÓƵҲÊÇÃâ·ÑµÄ£¬Ò»Ìì¾ÍÄÜѧÍ꣬ºÜ¼òµ¥¡¢ºÜ¿ì½Ý£¬×¢²á»¹ÓÐרÃŵÄÈ˵绰»Ø·Ã´ðÒÉ¡£
Èç¹ûÓÐÐËȤ¿ÉÒÔÁ˽âÒ»ÏÂÔÆ±í£¬ÎÒÒ²ÔÚÓòÅÀ´ÍƼöµÄ£»
¹Ù·½Á´½Ó£ºhttps://www.iyunbiao.com/signup/TK4B20417
µÚÒ»²½£ºµã»÷µÚÒ»¸ö±í¸ñ£¬µ¥»÷ÓÒ¼ü£¬²é¿´´úÂë
µÚ¶þ²½£ºÖ±½Ó°Ñ±à³Ì¸´ÖƽøÈ¥£¬È»ºóµã»÷ÔËÐУ¬ÔËÐÐ×Ó¹ý³Ì/Óû§´°Ìå
µÚÈý²½£¬ÔËÐÐÍê±Ï£¬»Øµ½±íÒ»£¬ÒѾºÏ²¢Íê³É¡£É¸Ñ¡³ö±êÌâ
µÚËIJ½£¬Ñ¡¶¨³ýÈ¥µÚÒ»ÁеĶàÓà±êÌ⣬¿ì½Ý¼üCtrl+G&rarr¡ª¡ª¶¨Î»Ìõ¼þ¡ª¡ªÑ¡Ôñ¿É¼ûµ¥Ôª¸ñ¡ª¡ªÈ·¶¨¡ª¡ªµ¥»÷ÓÒ¼üɾ³ý
×îºóÊͷųöËùÓÐÊý¾Ý¼´¿É
Êý¾ÝºÏ²¢Ö®Ç°
Êý¾ÝºÏ²¢Ö®ºó
¶ÔÓÚ¾³£Ê¹ÓÃExcelµÄÈËÀ´Ëµ£¬ÔÚExcelÖÐʹÓÃSQLÄܸßЧ´¦ÀíÄãµÄÊý¾Ý£¬µ«¾ÝÎÒËùÖªExcelÖеÄSQLÓï·¨ÓëMySQLÊý¾ÝµÄÓï·¨»¹Óе㲻һÑù¡£ÏÖÔÚÎÒ¾ÍÀ´ÊµÀý˵Ã÷ÈçºÎÓÃSQLÓï¾ä¶Ô¶à¸ö¹¤×÷²¾½øÐлã×Ü¡£¼ÙÈçÎÒÃÇÒª»ã×ÜÈçÏÂÈý¸ö¹¤×÷²¾
1. ѧÉúÐÅÏ¢±í
2. ѧÉú³É¼¨±í
3. ѧÉúÐËȤ±í
½«ÕâÈý¸ö¹¤×÷²¾°´ÏàͬѧºÅ½øÐкϲ¢£¬´óÖ·ÖÈçϼ¸²½£º
1. ¼ÓÔØÊý¾Ý
ÔÚExcelÖУ¬ÒÀ´Îµã»÷£ºÊý¾Ý-×ÔÆäËüÀ´Ô´-À´×ÔMicrosoft Query-Excel Files*
È»ºóÔÙÕÒµ½ÄãExcel±í¸ñµÄ´æ·ÅĿ¼£¬ÈçÏÂͼ
µã»÷ÏÂÃæÄãÒª¼ÓÔصÄExcelÊý¾Ý±í£¬½øÈëÏÂÃæÒ³Ãæ
½«ÉÏͼ¿ÉÓõÄÈýÕÅ±í¶¼¼ÓÈëµ½Óұ߲éѯ½á¹ûÖеÄÁУ¬¼ÓÈëÍê³Éºóµã»÷ÏÂÒ»²½£¬Êý¾Ý¾Í¼ÓÔØÍê³ÉÁË¡£
2. ±àдSQL´úÂë²¢Ö´ÐÐ
½ÓÏÂÀ´µã»÷ÉÏÃæµÄSQL°´Å¥¿ªÊ¼Ð´SQLºÏ²¢´úÂë¡£µ¥´¿µÄºÏ²¢´úÂëÈçÏÂ
SELECT
tm.*,
tn.ÐËȤ°®ºÃ AS ÐËȤ°®ºÃ
FROM(
SELECT
ta.ѧºÅ AS ѧºÅ,
ta.ÐÕÃû AS ÐÕÃû,
ta.ÄêÁä AS ÄêÁä,
ta.ÐÔ±ð AS ÐÔ±ð,
ta.Éí¸ß AS Éí¸ß,
ta.³öÉúµØ AS ³öÉúµØ,
tb.ÓïÎijɼ¨ AS ÓïÎijɼ¨,
tb.Êýѧ³É¼¨ AS Êýѧ³É¼¨
FROM(
SELECT
tt.ѧºÅ AS ѧºÅ,
tt.ÐÕÃû AS ÐÕÃû,
tt.ÄêÁä AS ÄêÁä,
tt.ÐÔ±ð AS ÐÔ±ð,
tt.Éí¸ß AS Éí¸ß,
tt.³öÉúµØ AS ³öÉúµØ
FROM [ѧÉú»ù±¾ÐÅÏ¢±í$] tt
)ta
INNER JOIN(
SELECT
tt.ѧºÅ AS ѧºÅ,
tt.ÓïÎijɼ¨ AS ÓïÎijɼ¨,
tt.Êýѧ³É¼¨ AS Êýѧ³É¼¨
FROM [ѧÉú³É¼¨±í$] tt
)tb
ON ta.ѧºÅ=tb.ѧºÅ
)tm
INNER JOIN(
SELECT
tt.ѧºÅ AS ѧºÅ,
tt.ÐËȤ°®ºÃ AS ÐËȤ°®ºÃ
FROM [ѧÉúÐËȤ±í$] tt
)tn
ON tm.ѧºÅ=tn.ѧºÅ
½«´úÂëдºÃºó¸´ÖÆ·ÅÈëÎı¾¿òÖУ¬µã»÷È·¶¨°´Å¥£¬¾Í¿ªÊ¼Ö´ÐÐSQLÓï¾ä¡£½á¹ûÈçÏÂ
ÕâÑù¾ÍÍê³ÉÁËÈý¸ö¹¤×÷²¾µÄÊý¾ÝºÏ²¢£¬½ÓÏÂÀ´½«Êý¾Ý·µ»ØExcel±í¡£
3. ·µ»ØÊý¾Ýµ½Excel±í
µã»÷×óÉϽǵÄÎļþ-½«Êý¾Ý·µ»ØMicrosoft Excel£¬µ¯³öÈçÏÂÒ³Ãæ
Ñ¡ÔñÊý¾ÝµÄ´æ·ÅλÖÃΪй¤×÷±í£¬È»ºóµã»÷È·¶¨¼´¿É£¬×îÖյõ½ÈçÏÂÊý¾Ý±í
ÕâÑù¾ÍÍê³ÉÁËÈý¸ö¹¤×÷²¾µÄÊý¾ÝºÏ²¢¡£
Tips£º
1. ÓÉÓÚExcelÖÐÖ´ÐÐSQLÓï¾äʱûÓбȽÏÏêϸµÄ±¨´íÐÅÏ¢£¬Èç¹ûSQL´úÂëÓï·¨ÓдíÎóÓпÉÄÜÖ´Ðлᱨ´í£¬Õâ¸öÎÊÌâ¿ÉÒÔÉÏÍø²éѯ»òÕßÖ±½ÓÔÚÆÀÂÛÇøÎÊÎÒ¡£
2. ÔÚExcel SQLÖг£Óõ½µÄºÏ²¢²Ù×÷ÓÐINNER JOIN¡¢LEFT JOIN¡¢RIGHT JOIN¡¢UNION¡¢UNION ALLµÈ£¬µ«²»Ö§³ÖFULL JOIN¡£¸ü¸´ÔÓµÄÐèÇó¶¼ÓÐÒ»¶¨µÄ´¦Àí¼¼ÇÉ¡£
ɨÂë²ÎÓëÐÂÆ·0ÔªÊÔÓÃ
ɹµ¥¡¢¶¥Â¥ºÀÀñµÈÄãÄÃ