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

mysql Óαê

¶¨ÒåÓαê 
DECLARE cur_Ãû³Æ CURSOR
FOR
SELECT ×Ö¶Î1,×Ö¶Î2,...×Ö¶În from ±í where ×Ö¶Î1=±äÁ¿;
DECLARE CONTINUE HANDLER FOR SQLSTATE '02000' SET ±äÁ¿1=null,±äÁ¿2=null;
OPEN cur_Ãû³Æ;
FETCH cur_Ãû³Æ INTO ±äÁ¿1,±äÁ¿2...;
WHILE ( ±äÁ¿1  IS NOT NULL) DO
          ...
          FETCH cur_Ãû³Æ INTO ±äÁ¿1,±äÁ¿2...;
END WHILE;
Èç¹ûÓαêµÄÌõ¼þÒª±ä»¯£¬ÔÚ¶¨Òåʱ½«×Ö¶Î1µÈ±äÀí£¬ÔÚ´ò¿ª±äÁ¿ºóΪÏàÓ¦±äÁ¿¸³Öµ¼´¿É¡£


Ïà¹ØÎĵµ£º

mysqlÖÐÎÄÅÅÐò¼°javaÖÐÎÄÅÅÐò


Ö®ËùÒÔдÕâƪ²©¿Í£¬ÊÇÒòΪǰ¼¸Ìì²ÅÅöµ½ÁËÕâôһ¸öÎÊÌ⣬ÒÔÇ°»¹²»ÖªµÀmysqlÓÐÕâôһ¸öÎÊÌâ¡£
ÎÒÃǵÄϵͳʹÓÃÁËstruts+hibernate£¬Êý¾Ý¿âʹÓõÄÊÇmysql£¬×Ö·û¼¯Í³Ò»Îªutf-8¡£
±¾À´ÒѾ­Íê³ÉÁË£¬µ«ÊÇϵͳʹÓõÄʱºò£¬·¢ÏÖ²é³öÀ´µÄÈËÃûûÓÐ˳Ðò£¬±¾À´ÒÔΪºÜ¼òµ¥£¬ÔÚ²éѯµÄʱºò£¬Ö¸¶¨°´ÕÕnameÅÅÐò¾Í¿ÉÒÔÁË£¬Æñ֪ʵ¼ÊÒ»×ö²Å·¢Ï ......

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_st ......

MySQLÖ®¶¯Ì¬±íÌØÕ÷

Èç¹ûÒ»¸öMyISAM±í°üº¬Èκοɱ䳤¶ÈÁУ¨VARCHAR, BLOB»òTEXTDynamic£©£¬»òÕßÈç¹ûÒ»¸ö±í±»ÓÃROW_FORMAT=DYNAMICÑ¡ÏîÀ´´´½¨£¬¶¯Ì¬´æ´¢¸ñʽ±»Ê¹Óá£
 
Õâ¸ö¸ñʽ¸üΪ¸´ÔÓÒ»µã£¬ÒòΪÿÐÐÓÐÒ»¸ö±íÃ÷ÐÐÓж೤µÄÍ·¡£µ±Ò»¸ö¼Ç¼ÒòΪ¸üеĽá¹û±»±äµÃ¸ü³¤£¬¸Ã¼Ç¼Ҳ¿ÉÒÔÔÚ³¬¹ýÒ»¸öλÖô¦½áÊø¡£
 
Äã¿ÉÒÔʹÓÃOPTIMIZE TAB ......

dz̸MysQLÖÐHANDLERÓï·¨½éÉܼ°Ê¹ÓÃ

½ñÌìС±àÒªºÍ´ó¼Ò˵µÄÊÇhandlerµÄÓ÷¨£¬Ï£Íû¶Ô´ó¼ÒÓÐËù°ïÖú¡£
HANDLER tbl_name OPEN [ AS alias ]
HANDLER tbl_name READ index_name { = | >= | <= | < } (value1,value2,...)
    [ WHERE where_condition ] [LIMIT ... ]
HANDLER tbl_name READ index_name { FIRST | NEXT | PREV | LAST } ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ