mysql:16340
From: <yata.s15ste@xxxxxxxxxx>
Date: Mon, 23 May 2016 16:28:30 +0900
Subject: [mysql 16340] ¥¹¥È¥¢¥ÉÆâSelectInto¶ç¤ÎµóÆ°¤Ë¤Ä¤¤¤Æ¡ÊMySQL5.7¡Ë
½é¤á¤ÆÅê¹Æ¤µ¤»¤Æ¤¤¤¿¤À¤¤Þ¤¹¡£ ³«È¯¼Ô¤Î¤¿¤¯¤ä¤È¿½¤·¤Þ¤¹¡£ ÅöÊý¤¬ÍøÍѤ·¤Æ¤¤¤ë´Ä¶¤Ë¤ª¤¤¤Æ¡¢ ÉÔ¶ñ¹ç¤«»ÅÍÍÄ̤꤫¤É¤¦¤«È½ÃǤ·¤«¤Í¤ë»ö¾Ý¤¬È¯À¸¤·¤¿¤Î¤Ç¡¢ ³§ÍͤÎÃηäò¤ª¼Ú¤ê¤·¤¿¤¤¤È»×¤¤Åê¹Æ¤µ¤»¤Æ¤¤¤¿¤À¤¤Þ¤·¤¿¡£ [³µÍ×] ¡¡MySQL5.7·Ï´Ä¶¤Ë¤ª¤¤¤Æ¡¢ ¡¡¥¹¥È¥¢¥É¥×¥í¥·¡¼¥¸¥ã¡Ê¤â¤·¤¯¤Ï¥Õ¥¡¥ó¥¯¥·¥ç¥ó¡ËÆâ¤Ç ¡¡È󥡼¹àÌܤˤè¤ëWhere¾ò·ï¤òÀßÄꤷ¡¢ ¡¡Select Into ¶ç¤òÍøÍѤ·¤¿¤È¤¤ÎµóÆ°¤¬»×ÏǤȰۤʤ롣 [¼Â¹Ô´Ä¶] ¡¦Linux RHEL6·Ï ¡¦MySQL 5.7.10-log Community Server ¡¡¡¦¥¹¥¡¼¥Þ¤Î¥Ç¥Õ¥©¥ë¥Èʸ»ú¥³¡¼¥É¤ÏUTF-8 [ºÆ¸½¼ê½ç] ¡¡£±¡ËÁ°Äó¤È¤·¤Æ¡¢°Ê²¼¥Æ¡¼¥Ö¥ë¤òºî¤Ã¤Æ¤ª¤¯¡£ ¡¡CREATE TABLE `dtb_test` ( ¡¡`iddtb_test` int(11) NOT NULL AUTO_INCREMENT, ¡¡`cd` varchar(12) DEFAULT '', ¡¡`word` varchar(45) DEFAULT NULL, ¡¡PRIMARY KEY (`iddtb_test`) ¡¡) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8; ¡¡£²¡Ë°Ê²¼¥Ç¡¼¥¿¤òÀßÄꤹ¤ë¡£ ¡iddtb_test ¢cd £word |--------------| |¡| ¢| £| |--------------| |1| 1111| aaaa| |2| 2222| bbbb| |3| 3333| cccc| |4| 4444| dddd| |5| 5555| eeee| ---------------- ¡¡£³¡Ë°Ê²¼¥¹¥È¥¢¥É¤ò¥Ç¥â¤È¤·¤ÆºîÀ®¤¹¤ë¡£ DELIMITER $$ CREATE PROCEDURE `test_proc`() BEGIN declare var_text text default ''; declare var_text2 varchar(45) default ''; select word,word into var_text,var_text2 from dtb_test where cd = '1111'; select var_text,var_text2; END$$ DELIMITER ; ¡¡£´¡ËºîÀ®¤·¤¿¥¹¥È¥¢¥É¤ò¼Â¹Ô¤¹¤ë¡£ [µá¤á¤ë·ë²Ì¤È¤·¤Æ] ¡¡¡¡ºÇ¸å¤ÎSelectʸ¤Ç½ÐÎϤµ¤ì¤ë·ë²Ì¤¬¤¤¤º¤ì¤â[aaaa]¤È¤Ê¤ë¤³¤È¡£ [·ë²Ì] ¡¡¡¡var_text ->[eeee]¡Ê¤³¤Á¤é¤¬»×ÏǤȰۤʤë¡Ë ¡¡¡¡var_text2->[aaaa] [Êä»ö¹à] ¡¡¡¦MySQL 5.6.26 Community Server (Windows7)¤Ç¤Ïµá¤á¤ë·ë²Ìvar_text ->[aaaa] ¤¬½ÐÎϤµ¤ì¤Þ¤·¤¿¡£ ¡¡¡¦³ºÅö¤Î¾ò·ï¶ç¤Ç¤¢¤ëcd¤òInt·¿¤ËÊѹ¹¤·¤Æ¤âvar_text ->[eeee]¤Ç½ÐÎϤµ¤ì¤Þ¤· ¤¿¡£ ¡¡¡¦¾ò·ï¶ç¤Îcd¤ËÂФ·¤ÆUnique Index¤òÉÕÍ¿¤¹¤ë¤È¡¢var_text ->[aaaa]¤Ç½ÐÎϤµ¤ì ¤Þ¤·¤¿¡£ ¡¡¡¦¸µ¡¹¤Ï͹ÊØÈÖ¹æTBL¤Îzipcode¤Ç¸¡º÷¤ò¤«¤±¤ë¤è¤¦¤Ê½èÍý¤Î¤È¤¤ËȯÀ¸¤·¤¿»ö¾Ý¤Î °Ù¡¢ ¡¡¡¡Unique Index¤ò»ÅÍÍŪ¤ËÉÕÍ¿¤Ç¤¤«¤Í¤Þ¤¹¡£ ¡¡¡¦Select Into»þ¤Ë Convert(word,char)¤ò¤¹¤ë¤Èvar_text ->[aaaa]¤Ç½ÐÎϤµ¤ì¤Þ ¤·¤¿¡£ ¸½¾Ý¤¬È¯À¸¤·¤Æ¤«¤é¡¢Êä»ö¹à¤ËÄ󼨤·¤¿¥Ñ¥¿¡¼¥ó¤Ê¤É¤ò¸¡¾Ú¤·¤Þ¤·¤¿¡£ ¸¡¾Ú¤Î·ë²Ì¡¢varchar·¿¤Îʸ»úÎó¤òTEXT·¿ÊÑ¿ô¤ËÆþ¤ì¤ëºÝ¤Ë ¾ò·ï¶ç¤ò¥¹¥ë¡¼¤·¤Æ¤·¤Þ¤¦¤è¤¦¤ÊÉÔ¶ñ¹ç¤¬¤¢¤ë¤Î¤Î¤«¤Ê¤È¤â»×¤Ã¤Æ¤¤¤Þ¤¹¤¬¡¢ ¤â¤·¤«¤·¤¿¤éTEXT·¿¤Èvarchar·¿¤¬Èó¸ß´¹¤È¤¤¤¦²ÄǽÀ¤â¹Í¤¨¤Æ¡¢ ¼ÁÌ䤵¤»¤Æ¤¤¤¿¤À¤¤Þ¤·¤¿¡£ ¤É¤Ê¤¿¤«¤´¶µ¼¨¤¤¤¿¤À¤±¤ì¤Ð¹¬¤¤¤Ç¤¹¡£ °Ê¾å¡¢¤è¤í¤·¤¯¤ª´ê¤¤¤¤¤¿¤·¤Þ¤¹¡£
-> 16340 2016-05-23 16:28 [<yata.s15ste@xxxxxxx] ¥¹¥È¥¢¥ÉÆâSelectInto¶ç¤ÎµóÆ°¤Ë¤Ä¤¤¤Æ¡ÊMySQL5.7¡Ë 16341 2016-05-24 11:00 ¨±["yoku ts." <yoku0825] Re: [mysql 16340] ¥¹¥È¥¢¥ÉÆâSelectInto¶ç¤ÎµóÆ°¤Ë¤Ä¤¤¤Æ¡ÊMySQL5.7¡Ë 16342 2016-05-24 12:43 ¡¡¨±[¤¿¤¯¤ä <yata.s15ste@] RE: [mysql 16341] Re: [mysql 16340] ¥¹¥È¥¢¥ÉÆâSelectInto¶ç¤ÎµóÆ°¤Ë¤Ä¤¤¤Æ¡ÊMySQL5.7¡Ë 16343 2016-05-25 14:15 ¡¡¡¡¨±["yoku ts." <yoku0825] Re: [mysql 16342] RE: [mysql 16341] Re: [mysql 16340] ¥¹¥È¥¢¥ÉÆâSelectInto¶ç¤ÎµóÆ°¤Ë¤Ä¤¤¤Æ¡ÊMySQL5.7¡Ë 16344 2016-05-25 15:42 ¡¡¡¡¡¡¨±[¤¿¤¯¤ä <yata.s15ste@] RE: [mysql 16343] Re: [mysql 16342] RE: [mysql 16341] Re: [mysql 16340] ¥¹¥È¥¢¥ÉÆâSelectInto¶ç¤ÎµóÆ°¤Ë¤Ä¤¤¤Æ¡ÊMySQL5.7¡Ë 16345 2016-05-25 15:46 ¡¡¡¡¡¡¡¡¨±["yoku ts." <yoku0825] Re: [mysql 16344] RE: [mysql 16343] Re: [mysql 16342] RE: [mysql 16341] Re: [mysql 16340] ¥¹¥È¥¢¥ÉÆâSelectInto¶ç¤ÎµóÆ°¤Ë¤Ä¤¤¤Æ¡ÊMySQL5.7¡Ë 16346 2016-05-25 16:01 ¡¡¡¡¡¡¡¡¡¡¨±[¤¿¤¯¤ä <yata.s15ste@] RE: [mysql 16345] Re: [mysql 16344] RE: [mysql 16343] Re: [mysql 16342] RE: [mysql 16341] Re: [mysql 16340] ¥¹¥È¥¢¥ÉÆâSelectInto¶ç¤ÎµóÆ°¤Ë