ÓйØÓÚMysqlµÄMERGE±íÀàÐÍ
Ëû½«¶à¸ö±íÔÚÂß¼Éϵ±×÷Ò»¸ö±íÀ´²éѯ¡£Ëû½¨Á¢ºóÓÐÁ½¸öÎļþ£¬
¡¡¡¡.frm ±í½á¹¹¶¨Òå
¡¡¡¡.mrg union±íµÄÃû×ÖÇåµ¥
¡¡¡¡Á½¸ö»ù±¾±í:
¡¡¡¡CREATE TABLE TEST_MERGE_1(
¡¡¡¡ID INT(5) NOT NULL,
¡¡¡¡VALUE VARCHAR(100) NOT NULL,
¡¡¡¡PRIMARY KEY(ID)
¡¡¡¡)
¡¡¡¡CREATE TABLE TEST_MERGE_2(
¡¡¡¡ID INT(5) NOT NULL,
¡¡¡¡VALUE VARCHAR(100) NOT NULL,
¡¡¡¡PRIMARY KEY(ID)
¡¡¡¡)
¡¡¡¡MERGE±íµÄ½¨Á¢£º
¡¡¡¡CREATE TABLE TEST_MERGE(
¡¡¡¡ID INT(5) NOT NULL,
¡¡¡¡VALUE VARCHAR(100) NOT NULL,
¡¡¡¡PRIMARY KEY(ID)
¡¡¡¡) TYPE=MERGE UNION=(TEST_MERGE_1,TEST_MERGE_2) INSERT_METHOD=LAST;
¡¡¡¡1. ´Ë±íÀàËÆÓÚSQLÖеÄunion»úÖÆ¡£
¡¡¡¡2. ´Ë±í½á¹¹±ØÐëÓë»ù±¾±íÍêÈ«Ò»Ö£¬°üÀ¨ÁÐÃû¡¢Ë³Ðò¡£UNION±í±ØÐëͬÊôÒ»¸öDATABASE¡£
¡¡¡¡3. »ù±¾±íÀàÐͱØÐëÊÇMyISAM¡£
¡¡¡¡4. ¿ÉÒÔͨ¹ýÐÞ¸Ä.mrgÎļþÀ´ÐÞ¸ÄMERGE±í£¬Ã¿¸ö»ù±¾±íµÄÃû×ÖÕ¼Ò»ÐС£×¢Ò⣺Ð޸ĺóҪͨ¹ýFLUSH TABLESË¢Ð屒ȼ´æ¡£
¡¡¡¡5. ¶Ô»ù±¾±íµÄ¸ü¸Ä¿ÉÒÔÖ±½Ó·´Ó³Ôڴ˱íÉÏ¡£
¡¡¡¡6. INSERT_METHODµÄÈ¡Öµ¿ÉÒÔÊÇ£º 0 ²»ÔÊÐí²åÈë FIRST ²åÈëµ½UNIONÖеĵÚÒ»¸ö±í LAST ²åÈëµ½UNIONÖеÄ×îºóÒ»¸ö±í¡£(4.0Ö®ºó¿ÉÓÃ)
¡¡¡¡7. ¶¨ÒåÔÚËüÉÏÃæµÄÔ¼ÊøûÓÐÈκÎ×÷Óã¬Ô¼ÊøÊÇÓÉ»ù±¾±í¿ØÖƵģ¬ÀýÈçÁ½¸ö»ù±¾±íÖдæÔÚ×ÅͬÑùµÄÒ»¸öKeyÖµ£¬ÄÇôÔÚMERGE±íÖлáÓÐÁ½¸öÒ»ÑùµÄKeyÖµ¡£
À´Ô´µØÖ·£ºhttp://www.wangchao.net.cn/bbsdetail_542711.html
Ïà¹ØÎĵµ£º
¶Ïµç»ò·ÇÕý³£¹Ø»ú¶øµ¼ÖÂMySQL(ºÍPHP´îÅäÖ®×î¼Ñ×éºÏ)Êý¾Ý¿â³öÏÖ´íÎóÊǷdz£³£¼ûµÄÎÊÌâ¡£ÓÐÁ½ÖÖ·½·¨£¬Ò»ÖÖ·½·¨Ê¹ÓÃMySQL(ºÍPHP´îÅäÖ®×î¼Ñ×éºÏ)µÄcheck tableºÍrepair table µÄsqlÓï¾ä£¬ÁíÒ»ÖÖ·½·¨ÊÇʹÓÃMySQL(ºÍPHP´îÅäÖ®×î¼Ñ×éºÏ)ÌṩµÄ¶à¸ömyisamchk, isamchkÊý¾Ý¼ì²â»Ö¸´¹¤¾ß¡£Ç°ÕßʹÓÃÆðÀ´±È½Ï¼ò±ã¡£ÍƼöʹÓá£
1. ......
mysql ½Øȡijһ¸öʱ¼ä(datetimeÀàÐÍ)µÄÈÕÆÚ£º
·½·¨1£ºselect date(row_name) from table_name where row = row1;
·½·¨2£ºselect left(row_name, 10) from table_name where row = row1;
·½·¨3£ºselect cast(row_name as char[10]) from table_name where row = row1;
È¡µÃij¸öÈÕÆÚµÄtime_tÊýÖµ£ºselect unix_times ......
´Ómysql±¸·Ý³öÀ´µÄsqlÎļþ½øÐл¹Ô²Ù×÷ʱ±¨´í£¬²é¿´´íÎóÈÕÖ¾£¬ÄÚÈÝÈçÏ£º
Error Code: 1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=50913 DEFAULT CHARSET=gbk' at li ......
http://hi.baidu.com/xuwanbest/blog/item/193fd93dda509303bba167e3.html
http://wangdei.javaeye.com/blog/214265
¹ØÓÚ MySQL µ÷ÓÅ
ÓÐ 3 ÖÖ·½·¨¿ÉÒÔ¼Ó¿ì MySQL ·þÎñÆ÷µÄÔËÐÐËٶȣ¬Ð§Âʴӵ͵½¸ßÒÀ´ÎΪ£º
Ìæ»»ÓÐÎÊÌâµÄÓ²¼þ¡£
¶Ô MySQL ½ø³ÌµÄÉèÖýøÐе÷ÓÅ¡£
¶Ô²éѯ½øÐÐÓÅ»¯¡£
ǨÒƵ½ DB2
ÄúÕýÔÚÑ°ÕÒÒ»Öָɾ»À ......
°æȨÉùÃ÷£º¿ÉÒÔÈÎÒâתÔØ£¬×ªÔØʱÇëÎñ±ØÒÔ³¬Á´½ÓÐÎʽ±êÃ÷ÎÄÕÂÔʼ³ö´¦ºÍ×÷ÕßÐÅÏ¢¼°±¾ÉùÃ÷
http://www.5ilinux.com/lamp01.html
¹Ø¼ü×Ö£ºapache+mysql+php apache mysql php ÅäÖà lamp ·þÎñÆ÷ web
Linux+Apache+Mysql+PHPµäÐÍÅäÖÃ
µ÷ÊÔ»·¾³£ºRedhat9.0 Apache1.3.29 Mysql3.23.58 PHP4.3.4
LinuxϵͳµÄ°²×°ÎҾͲ»½²Á ......