sqlÖÐÌåÏÖ²¢¼¯µÄÒªº¦×ÖÓÐÄÄЩ
ÔÚ sql ÖУ¬ÌåÏÖ²¢¼¯µÄÒªº¦×ÖÊÇ union£¬ÓÃÓÚ½«¶à¸ö select Óï¾äµÄЧ¹ûºÏ²¢Îª°üÀ¨ËùÓÐΨһÐеĵ¥¸öЧ¹û¼¯¡£
SQL ÖÐÌåÏÖ²¢¼¯µÄÒªº¦×Ö
ÔÚ SQL ÖУ¬ÌåÏÖ²¢¼¯µÄÒªº¦×ÖÊÇ£º
UNION
ʹÓà UNION
UNION Òªº¦×ÖÓÃÓÚ½«Á½¸ö»ò¶à¸ö SELECT Óï¾äµÄЧ¹ûºÏ²¢Îªµ¥¸öЧ¹û¼¯¡£¸ÃЧ¹û¼¯°üÀ¨Á½¸öÊäÈë±íÖÐËùÓÐΨһÐС£
Óï·¨£º
SELECT ÁÐÃû1, ÁÐÃû2, ... FROM ±íÃû1 UNION SELECT ÁÐÃû1, ÁÐÃû2, ... FROM ±íÃû2;
µÇ¼ºó¸´ÖÆ
ÀýÈ磺
SELECT name, city FROM table1 UNION SELECT name, city FROM table2;
µÇ¼ºó¸´ÖÆ
ÒÔÉÏÅÌÎʽ«·µ»Ø table1 ºÍ table2 ±íÖÐËùÓÐΨһÐÐµÄ name ºÍ city ÁС£
ÒÔÉϾÍÊÇsqlÖÐÌåÏÖ²¢¼¯µÄÒªº¦×ÖÓÐÄÄЩµÄÏêϸÄÚÈÝ£¬¸ü¶àÇë¹Ø×¢±¾ÍøÄÚÆäËüÏà¹ØÎÄÕ£¡
ÃâÔð˵Ã÷£ºÒÔÉÏչʾÄÚÈÝȪԴÓÚÏàÖúýÌå¡¢ÆóÒµ»ú¹¹¡¢ÍøÓÑÌṩ»òÍøÂçÍøÂçÕûÀí£¬°æȨÕùÒéÓë±¾Õ¾Î޹أ¬ÎÄÕÂÉæ¼°¿´·¨Óë¿´·¨²»´ú±í尊龙凯时人生就是博ÂËÓÍ»úÍø¹Ù·½Ì¬¶È£¬Çë¶ÁÕß½ö×ö²Î¿¼¡£±¾ÎĽӴýתÔØ£¬×ªÔØÇë˵Ã÷À´ÓÉ¡£ÈôÄúÒÔΪ±¾ÎÄÇÖÕ¼ÁËÄúµÄ°æȨÐÅÏ¢£¬»òÄú·¢Ã÷¸ÃÄÚÈÝÓÐÈκÎÉæ¼°ÓÐÎ¥¹«µÂ¡¢Ã°·¸Ö´·¨µÈÎ¥·¨ÐÅÏ¢£¬ÇëÄúÁ¬Ã¦ÁªÏµ尊龙凯时人生就是博ʵʱÐÞÕý»òɾ³ý¡£