Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

MySQLÖеÄCREATE VIEWÓï·¨

CREATE [OR REPLACE] [ALGORITHM = {UNDEFINED | MERGE | TEMPTABLE}]
    VIEW view_name [(column_list)]
    AS select_statement
    [WITH [CASCADED | LOCAL] CHECK OPTION]
¸ÃÓï¾äÄÜ´´½¨ÐµÄÊÓͼ£¬Èç¹û¸ø¶¨ÁËOR REPLACE×Ӿ䣬¸ÃÓï¾ä»¹ÄÜÌæ»»ÒÑÓеÄÊÓͼ¡£select_statementÊÇÒ»ÖÖSELECTÓï¾ä£¬Ëü¸ø³öÁËÊÓͼµÄ¶¨Òå¡£¸ÃÓï¾ä¿É´Ó»ù±í»òÆäËûÊÓͼ½øÐÐÑ¡Ôñ¡£
¸ÃÓï¾äÒªÇó¾ßÓÐÕë¶ÔÊÓͼµÄCREATE VIEWȨÏÞ£¬ÒÔ¼°Õë¶ÔÓÉSELECTÓï¾äÑ¡ÔñµÄÿһÁÐÉϵÄijЩȨÏÞ¡£¶ÔÓÚÔÚSELECTÓï¾äÖÐÆäËûµØ·½Ê¹ÓõÄÁУ¬±ØÐë¾ßÓÐSELECTȨÏÞ¡£Èç¹û»¹ÓÐOR REPLACE×Ӿ䣬±ØÐëÔÚÊÓͼÉϾßÓÐDROPȨÏÞ¡£
ÊÓͼÊôÓÚÊý¾Ý¿â¡£ÔÚĬÈÏÇé¿öÏ£¬½«ÔÚµ±Ç°Êý¾Ý¿â´´½¨ÐÂÊÓͼ¡£ÒªÏëÔÚ¸ø¶¨Êý¾Ý¿âÖÐÃ÷È·´´½¨ÊÓͼ£¬´´½¨Ê±£¬Ó¦½«Ãû³ÆÖ¸¶¨Îªdb_name.view_name¡£
mysql> CREATE VIEW test.v AS SELECT * from t;
±íºÍÊÓͼ¹²ÏíÊý¾Ý¿âÖÐÏàͬµÄÃû³Æ¿Õ¼ä£¬Òò´Ë£¬Êý¾Ý¿â²»ÄÜ°üº¬¾ßÓÐÏàͬÃû³ÆµÄ±íºÍÊÓͼ¡£
ÊÓͼ±ØÐë¾ßÓÐΨһµÄÁÐÃû£¬²»µÃÓÐÖظ´£¬¾ÍÏñ»ù±íÄÇÑù¡£Ä¬ÈÏÇé¿öÏ£¬ÓÉSELECTÓï¾ä¼ìË÷µÄÁÐÃû½«ÓÃ×÷ÊÓͼÁÐÃû¡£ÒªÏëΪÊÓͼÁж¨ÒåÃ÷È·µÄÃû³Æ£¬¿ÉʹÓÿÉÑ¡µÄcolumn_list×Ӿ䣬ÁгöÓɶººÅ¸ô¿ªµÄID¡£column_listÖеÄÃû³ÆÊýÄ¿±ØÐëµÈÓÚSELECTÓï¾ä¼ìË÷µÄÁÐÊý¡£
SELECTÓï¾ä¼ìË÷µÄÁпÉÒÔÊǶԱíÁеļòµ¥ÒýÓá£Ò²¿ÉÒÔÊÇʹÓú¯Êý¡¢³£Á¿Öµ¡¢²Ù×÷·ûµÈµÄ±í´ïʽ¡£
¶ÔÓÚSELECTÓï¾äÖв»ºÏ¸ñµÄ±í»òÊÓͼ£¬½«¸ù¾ÝĬÈϵÄÊý¾Ý¿â½øÐнâÊÍ¡£Í¨¹ýÓÃÇ¡µ±µÄÊý¾Ý¿âÃû³ÆÏÞ¶¨±í»òÊÓͼÃû£¬ÊÓͼÄܹ»ÒýÓñí»òÆäËûÊý¾Ý¿âÖеÄÊÓͼ¡£
Äܹ»Ê¹ÓöàÖÖSELECTÓï¾ä´´½¨ÊÓͼ¡£ÊÓͼÄܹ»ÒýÓûù±í»òÆäËûÊÓͼ¡£ËüÄÜʹÓÃÁªºÏ¡¢UNIONºÍ×Ó²éѯ¡£SELECTÉõÖÁ²»ÐèÒýÓÃÈÎºÎ±í¡£ÔÚÏÂÃæµÄʾÀýÖУ¬¶¨ÒåÁË´ÓÁíÒ»±íÑ¡ÔñÁ½ÁеÄÊÓͼ£¬²¢¸ø³öÁ˸ù¾ÝÕâЩÁмÆËãµÄ±í´ïʽ£º
mysql> CREATE TABLE t (qty INT, price INT);
mysql> INSERT INTO t VALUES(3, 50);
mysql> CREATE VIEW v AS SELECT qty, price, qty*price AS value from t;
mysql> SELECT * from v;
+------+-------+-------+
| qty  | price | value |
+------+-------+-------+
|    3 |    50 |   150 |
+------+-------+-------+
ÊÓͼ¶¨Òå·þ´ÓÏÂÊöÏÞÖÆ£º
·         SELECTÓï¾ä²»ÄÜ°üº¬from×Ó¾äÖеÄ×Ó²éѯ¡£
·  &n


Ïà¹ØÎĵµ£º

mysqlÓÃjdbcÁ¬½Ó

Ê×ÏÈ·ÅÖúÃjdbcÇý¶¯³ÌÐò£¬ÔÚ java\jre6\lib\ext\Ï£¬java\jdk1.6\jre\libµÈµØ·½¶¼·ÅÆðÀ´£¬ÒòΪ²»È·¶¨ÔÚÄÄÀïÓÐÓ÷··
Class.forName("com.mysql.jdbc.Driver").newInstance();
 String url = "jdbc:mysql://localhost/DATABASENAME?user=USERNAME&password=PASSWORD&useUnicode=tru ......

MySQL 6 ÂÌÉ«¾«¼òBAT°æ

 
¹Ø¼ü×Ö: mysql6 mysql6ÏÂÔØ
×÷ΪһÃû¿ª·¢ÈËÔ±,ÎÒ¶ÔÂÌɫСÈí¼þÇéÓжÀÖÓ,ÒòΪÓÃÆðÀ´·½±ã¿ì½ÝÂï,±ãÓÚЯ´ø,Ò×ÓÚÔÚÑÝʾϵͳÖÐʹÓÃ,¿ª·¢Ê±¿ÉÁ¢¼´½øÈë״̬. £¨ÔÚ¸½¼þÖУ©
ÒÔÏÂÊÇÏêϸ˵Ã÷:
MySQL 6 ÂÌÉ«¾«¼ò°æ(BAT°æ±¾)
        MySQL 6 Ö§³ÖÍâ¼ü,ÊÓͼ´æ´¢¹ý³Ì,ÊÂÎñµÈ¹¦ÄÜ(ÂÌÉ«¾« ......

mysql Êý¾Ý´æ´¢×ܽá

ÓÉÓÚ×î½üÒ»Ö±ÔÚÁ˽âmysql¡£¸÷ÖÖ±íÀàÐ͵ÄÊý¾Ý´æ´¢ÒÔ¼°Ïà¹ØÏÞÖƾÍÊDZØÐëÁ˽âµÄ·½ÃæÁË¡£
×Ô¼ºµÄ·þÎñÆ÷»·¾³£ºOS Cent OS ext3£¬memory 4G£¬ disk 2T block size 4K¡£
¾­µ÷²é£¬linuxÏÂÎļþ×î´óÊÇ´æÔÚÏÞÖƵġ£È¥googleÉÏËÑÁËËÑ£¬´ó¼Ò˵·¨²»Ò»£¬×îÖÕ×Ô¼º»¹ÊÇÕÒµ½±È½Ï¹Ù·½µÄ˵¡£Ïê¼ûhttp://en.wikipedia.org/wiki/Ext3 ËùÒÔ× ......

mysqlÎļþµ¼ÈëÂÒÂëÎÊÌâµÄ½â¾ö£º

mysqlÎļþµ¼ÈëÂÒÂëÎÊÌâµÄ½â¾ö£º
1 ÃüÁî²ì¿´×Ö·ûÉèÖá£
mysql> show   variables   like   "%char%";
2 ½«²»ÊÇutf-8µÄ¶¼¸Ä³Éutf8¡£Ö»ÓÐfilesystem²»±ä;
| Variable_name            | Value
   &nb ......

MySQL Master/SlaveÊý¾Ý¿â¶Áд²Ù×÷Àà

Êý¾Ý¿â²Ù×÷ÀࣺDBCommon.class.php
//---------------------------------------------------------------------
// MySQL Master/SlaveÊý¾Ý¿â¶Áд²Ù×÷Àà
//
// ¿ª·¢×÷Õß: heiyeluren
// °æ±¾ÀúÊ·:
// 2006-09-20 »ù±¾µ¥Êý¾Ý¿â²Ù×÷¹¦ÄÜ, 25 ¸ö½Ó¿Ú
// 2007-07-30 Ö§³Öµ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ